easy_translate icon indicating copy to clipboard operation
easy_translate copied to clipboard

Rescue unexpected parsing error when request status is 500

Open foxlance opened this issue 2 years ago • 0 comments

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.

foxlance avatar Mar 23 '22 11:03 foxlance