Mangopay/mangopay2-ruby-sdk

Raise a specific exception when API fails with a 5XX HTTP response

kaderate opened this issue · 0 comments

When MangoPay API returns a 5XX, we receive a generic MangoPay::ResponseError that we must decode to identify from the response code that it's a network/internal error (a 502 for example).

It could ease error handling for the SDK users to raise a specific exception in those cases. For example, it allows them to silently retries on network errors, and immediatly raise in case of client (4xx) error.