# http-smart-error

> Subclass of SmartError for handling http errors.

Latest version **4.0.1** (published 2020-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-smart-error
pnpm add http-smart-error
yarn add http-smart-error
bun add http-smart-error
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2020-06-02 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 18.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lukas Macuda |
| Maintainers | zabkwak |
| Keywords | error, http |

## Links

- npm: https://www.npmjs.com/package/http-smart-error
- npm.io page: https://npm.io/package/http-smart-error

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 4.0.1 (latest) — 2020-06-02
- 4.0.0 — 2020-06-02
- 3.0.0 — 2019-08-30
- 2.0.0 — 2019-01-31
- 1.1.1 — 2018-08-16
- 1.1.0 — 2018-08-16
- 1.0.1 — 2018-06-26
- 1.0.0 — 2018-06-11

## README

# http-smart-error
Subclass of [SmartError](https://www.npmjs.com/package/smart-error) for handling http errors.

## Installation
```bash
npm install http-smart-error --save
```

## Usage
```javascript
import HttpSmartError from 'http-smart-error';

console.log(HttpSmartError.create(400)); // Http error with 400 status code, message "Bad request" and code "ERR_BAD_REQUEST"

console.log(HttpSmartError.create(403, 'User has no permissions to do that.', 'no_permission', { missing_permission: 'read.something'})); // Http error with 403 status code, message "User has no permissions to do that.", code "ERR_NO_PERMISSION" and extra field "missing_permission" with "read.something" value.
```

## Migration to V4
- `smart-error` module is as peer dependency. It needs to be installed separately.

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