package
include response body in superagent errors for failed requests
npm install superagent-verbose-errorsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
187.3 kB
Includes dependencies.
include response body in superagent errors for failed requests
npm install --save superagent superagent-use superagent-verbose-errorsTo 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
}))