Retry http request when unexpected error occurs#97
Retry http request when unexpected error occurs#97hxiong388 merged 4 commits intogoogleapis:masterfrom serihiro:retry-request-with-unexpected-error
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
@googlebot I signed it! |
|
CLAs look good, thanks! |
|
|
||
| if retry_count > 0 | ||
| retry_count -= 1 | ||
| retry |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@serihiro Thanks for submitting this PR. Our team has recently taken over the ownership of this repository, and I'm in process of triaging the PRs and issues. I'll merge this PR once you can fix the rubocop violations. |
lib/googleauth/compute_engine.rb
Outdated
| when 404 | ||
| raise(Signet::AuthorizationError, NO_METADATA_SERVER_ERROR) | ||
| else | ||
| msg = "Unexpected error code #{resp.status}" + UNEXPECTED_ERROR_SUFFIX |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
lib/googleauth/signet.rb
Outdated
| begin | ||
| yield | ||
| rescue => e | ||
| raise e if e.is_a?(Signet::AuthorizationError) || e.is_a?(Signet::ParseError) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@hxiong388 |
|
@serihiro Thanks! Looks great. |
What will this PR change?
GCECredentials#fetch_access_tokenandUserRefreshCredentials#revoke!Signet::AuthorizationErrorwith the string oforiginal_error.inpsect