A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jcoreio/superagent-verbose-errors below:

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

superagent-verbose-errors

include response body in superagent errors for failed requests

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4