# @bouncingpixel/http-errors

> Error objects for HTTP status codes that can be thrown with status set

Latest version **1.1.0-beta** (published 2021-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bouncingpixel/http-errors
pnpm add @bouncingpixel/http-errors
yarn add @bouncingpixel/http-errors
bun add @bouncingpixel/http-errors
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0-beta |
| Published | 2021-01-19 |
| First published | 2017-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Matt Hall |
| Maintainers | hallmatt |

## Links

- npm: https://www.npmjs.com/package/@bouncingpixel/http-errors
- Repository: https://github.com/BouncingPixel/node-packages/tree/master/http-errors
- Homepage: https://github.com/BouncingPixel/node-packages
- Issues: https://github.com/BouncingPixel/node-packages/issues
- npm.io page: https://npm.io/package/@bouncingpixel/http-errors

## Recent versions

- 1.1.0-beta (latest) — 2021-01-19
- 1.0.0 — 2017-05-22

## README

# http-errors

A set of Error classes which contain a status set for handling errors in Express.

## Working With

### Requirements

- NodeJS 6 LTS

### Using http-errors

The following Error classes exist with the status set:

| Error                 | Status |
|-----------------------|:------:|
| BadRequestError       |  400   |
| NotAuthorizedError    |  401   |
| BannedError           |  402   |
| ForbiddenError        |  403   |
| NotFoundError         |  404   |
| AccountLockedError    |  429   |
| InternalServerError   |  500   |

To raise one of these errors, first require in the `@bouncingpixel/http-errors` package, then just use like any other Error
- call `next`, for example: `next(new HttpErrors.BadRequestError('My Error Message'));`
- or throw the error, for example `throw new HttpErrors.BadRequestError('My Error Message');`
- or use in a callback, for example `done(new HttpErrors.BadRequestError('My Error Message'));`
- or any other use of an Error object

---
_Source: https://npm.io/package/@bouncingpixel/http-errors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
