FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

jcoreio/superagent-verbose-errors: include response body in superagent errors for failed requests · GitHub

Repository files navigation

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

About

include response body in superagent errors for failed requests

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL