# mmp-errors

> MMP (matter in motion protocol) errors

Latest version **0.8.4** (published 2016-12-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install mmp-errors
pnpm add mmp-errors
yarn add mmp-errors
bun add mmp-errors
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.4 |
| Published | 2016-12-11 |
| First published | 2016-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexey Novikov |
| Maintainers | velocityzen |
| Keywords | api, microservice, framework, rpc, event, realtime, web, websocket, mm, errors |

## Links

- npm: https://www.npmjs.com/package/mmp-errors
- Repository: https://github.com/velocityzen/mmp-errors
- Homepage: https://github.com/velocityzen/mmp-errors#readme
- Issues: https://github.com/velocityzen/mmp-errors/issues
- npm.io page: https://npm.io/package/mmp-errors

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.8.4 (latest) — 2016-12-11
- 0.8.3 — 2016-05-03
- 0.8.2 — 2016-04-08
- 0.8.1 — 2016-03-16
- 0.8.0 — 2016-02-17

## README

#Matter in motion protocol error codes

More info about [matter in motion](http://https://github.com/velocityzen/matter-in-motion)

## Errors codes:

* **4000** Call — general error to return
* **4100** Unauthorized — unauthorized
* **4104** ProviderNotFound — Auth provider not found
* **4110** Forbidden — forbidden
* **4120** NotValidToken — token not valid or expired
* **4200** RequestValidation — request validation failed
* **4210** ResponseValidation — response validation failed
* **4220** RequestTooLarge — request entity too large
* **4230** RequestDecode — request decode error
* **4240** ResponseEncode — response encode error
* **4250** UnsupportedMedia — unsupported media
* **4400** MethodNotFound — method not found
* **4500** Duplicate — duplicate entity
* **4540** NotFound — not found
* **5000** ServerError — server error

## Usage
```js
let errors = require('mmp-errors');
//when you need to return an error:
return errors.NotFound();
//or
throw errors.NotFound();
```

```js
return error.Call(data, message);
//or
throw error.Call(data, message);
```

You can add any data and/or message to errors;

## Custom errors
```js
let errors = require('mmp-errors');
let CustomError = errors.Error(code, msg, toString);

//and then you can use it
return CustomError();
//or
throw CustomError();
```

* **code** — error code
* **message** — default message
* **toString** — optional toString function

License MIT

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