Fix retrying logic for HTTP responses with "Content-Type" other than "application/json"#2329
Conversation
…e" other than "application/json".
|
How does it get to the |
|
This is caused by (I believe) some key design decisions in google-api-client. When you make a http request you may define it as a JSON request (the request class extends Places, where things start going in a wrong direction are:
But regardless of these details, I believe the proposed fix is not only the simplest but at the same time the best we can have practically. In our clients retries are configured by error codes, not by content type. The current code, for some reason starts ignoring the error code if it cannot parse the message. Why? Error code should sill be treated as error code. It is ok to try to get more information from the message (it potentially allows to handle error better), bit if that does not succeed, we should fallback to checking just error code. |
|
ok, LGTM |
This should fix #2098