superagent-verbose-errors

1.0.1 • Public • Published

superagent-verbose-errors

Build Status Coverage Status semantic-release Commitizen friendly

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
}))

/superagent-verbose-errors/

    Package Sidebar

    Install

    npm i superagent-verbose-errors

    Weekly Downloads

    359

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    192 kB

    Total Files

    6

    Last publish

    Collaborators

    • jedwards1211