Closed hubertpompecki closed 6 years ago
When the back-end responds with a 500 error and the body of the following format:
{"message": "Internal server error"}
the gem is unable to form a proper error message and throws NoMethodError: undefined method 'first' for nil:NilClass. This makes debugging of the actual back-end response more difficult, see https://sentry.io/shift-commerce/matalan/issues/552886095/events/23884250449/ for an example.
NoMethodError: undefined method 'first' for nil:NilClass
This PR updates the gem so that it is able to correctly process responses like the one above and adds some tests coverage around this area.
When the back-end responds with a 500 error and the body of the following format:
the gem is unable to form a proper error message and throws
NoMethodError: undefined method 'first' for nil:NilClass
. This makes debugging of the actual back-end response more difficult, see https://sentry.io/shift-commerce/matalan/issues/552886095/events/23884250449/ for an example.This PR updates the gem so that it is able to correctly process responses like the one above and adds some tests coverage around this area.