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
If JSON.parse fails for any reason, it would be good to throw an error which would presumably be caught by the promise catch statement? Or has it been omitted for a reason?
The text was updated successfully, but these errors were encountered:
@richardgregory yes, it was done deliberately. Current implementation is a bit dumb. If response is a string, it tries to parse the response as JSON. If it fails, it is assumed that the response must not have been JSON, fails gracefully, and passes the string response along.
Hi,
I noticed the catch statement in the transformResponse method is empty (see line below).
https://github.com/mzabriskie/axios/blob/master/lib/defaults.js#L44
If JSON.parse fails for any reason, it would be good to throw an error which would presumably be caught by the promise catch statement? Or has it been omitted for a reason?
The text was updated successfully, but these errors were encountered: