Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for JSON before parsing JSON in errors
The createError function was incorrectly assuming that response bodies are in JSON format and attempting to extract useful details from that body. But, for some error cases, the body is not JSON resulting in a error being thrown during the process of adding details to the error. This fix adds safeguards around the places that need JSON to enable the createError method to extract the useful details.
- Loading branch information