forwardemail / forwardemail/superagent
Error JSON response aren't being parsed
Open
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
I noticed a JSON response with status `200` is parsed successfully by superagent (i.e. `response.body` contains the parsed JSON contents), but a JSON response with status `400` does not return a "body" property, even though the Content Type is "application/json". Any setting I'm missing to automatically parse error responses if the error content type is "application/json"?
My current workaround is to use:
``` js
var parsedError = JSON.parse(e.response.text);
```
Contributor guide
Assessment
This issue has not been assessed yet.