Package Exports
- superagent-verbose-errors
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (superagent-verbose-errors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
superagent-verbose-errors
include response body in superagent errors for failed requests
Usage
npm install --save superagent superagent-use superagent-verbose-errors
To make any superagent request that fails append the response body to its error message:
const superagent = require('superagent-use')(require('superagent'))
superagent.use(require('superagent-verbose-errors'))
To only include the response body for certain errors:
const superagent = require('superagent-use')(require('superagent'))
superagent.use(require('superagent-verbose-errors')({
filter: res => res.status === 400
}))