New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry http request when unexpected error occurs #97
Retry http request when unexpected error occurs #97
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
lib/googleauth/signet.rb
Outdated
|
||
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_token
andUserRefreshCredentials#revoke!
Signet::AuthorizationError
with the string oforiginal_error.inpsect