easy_translate
easy_translate copied to clipboard
Rescue unexpected parsing error when request status is 500
During unexpected situations when Google's service returns a 500 error, e.g. getting a 503 when you are making too many requests and are temporarily blocked, the response body is in HTML and therefore will raise an exception with JSON.parse.
In such cases, it would be better to fall back to the response code and message.
Also, updated some of the failing (outdated) tests.