fix: fix check for 'internal_failure' condition#387
fix: fix check for 'internal_failure' condition#387busunkim96 merged 2 commits intogoogleapis:masterfrom
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). 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 (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
|
@googlebot I signed it! |
|
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
…e `error' field In some cases response doesn't contain error_description field. So the retry won't work. The solution is to look at both error and error_description fields.
software-dov
left a comment
There was a problem hiding this comment.
This changes the test coverage: in test__token_endpoint_request_internal_failure_error, the first check should only have "error_description" set. Otherwise looks good.
Now test__token_endpoint_request_internal_failure_error contains two mutually exclusive cases.
software-dov
left a comment
There was a problem hiding this comment.
LGTM. Test could be refactored to loop over "error" and "error_description", but it's fine as is.
|
Fixed the test |
|
@georgysavva Thank you for submitting a patch! |
|
@georgysavva Do you think it's possible that, sometimes if we get errors from the server, the response will not be in json format, thus loading json from the response before checking ok would cause exception? |
|
@ziliangpeng totally makes sense. Should be a good improvement. Fill free to open a PR with the fix. |
As I was saying in this comment
In some cases response doesn't contain
error_descriptionfield. So the retry won't work. The solution is to look at botherroranderror_descriptionfields.