
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@httpie/errors
Advanced tools
The @httpie/errors package provides error classes with useful defaults. This avoids the boilerplate of setting up a custom error class in different projects.
Error base class capturing the stack trace by defaultname property providing the error’s class nameHttpError class with HTTP status and error code propertiesnpm i @httpie/errors
Using @httpie/errors is pretty straightforward. The package exports error classes that you can use like the native Error class.
const { Error, HttpError } = require('@httpie/errors')
// works like the native `Error` class and also contains the stacktrace
throw new Error('your error message')
// the HTTP Error provides a fluent interface to customize the properties
throw new HttpError('Request validation failed')
.withStatus(400)
.withCode('E_YOUR_CUSTOM_ERROR_CODE')
// or create an HTTP error by passing all arguments to the constructor
throw new HttpError('Request validation failed', 400, 'E_YOUR_CUSTOM_ERROR_CODE')
Do you miss a function? We very much appreciate your contribution! Please send in a pull request 😊
git checkout -b my-featuregit commit -am 'Add some feature'git push origin my-new-featureMIT © Supercharge
httpiejs.com · GitHub @httpie · Twitter @httpiejs
FAQs
Useful JavaScript error classes
We found that @httpie/errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.