You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case of HTTP errors 5XX, HTML can be returned - for example <head><title>api.mangopay.com | 520: Web server is returning an unknown error</title> ... or <head><title>502 Bad Gateway</title> ....
Current behavior
In this case the SDK throws MultiJson::ParseError because it tries to decode the response body before checking the status code. We could rescue the parse error and retry but it feels unsafe in case there are valid requests that return a non-JSON body.
Expected behavior
Ideally we can rescue MangoPay::ResponseError and depending on the status code we decide whether we retry the request or not.
The text was updated successfully, but these errors were encountered:
Context
In case of HTTP errors 5XX, HTML can be returned - for example
<head><title>api.mangopay.com | 520: Web server is returning an unknown error</title> ...
or<head><title>502 Bad Gateway</title> ...
.Current behavior
In this case the SDK throws
MultiJson::ParseError
because it tries to decode the response body before checking the status code. We could rescue the parse error and retry but it feels unsafe in case there are valid requests that return a non-JSON body.Expected behavior
Ideally we can rescue
MangoPay::ResponseError
and depending on the status code we decide whether we retry the request or not.The text was updated successfully, but these errors were encountered: