Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonepri/restify-errors-options-errno
☎️ Add errno to Restify's errors
https://github.com/simonepri/restify-errors-options-errno
restify restify-errors restify-errors-options restify-errors-options-errno
Last synced: 3 days ago
JSON representation
☎️ Add errno to Restify's errors
- Host: GitHub
- URL: https://github.com/simonepri/restify-errors-options-errno
- Owner: simonepri
- License: mit
- Created: 2017-07-31T14:17:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T20:07:56.000Z (almost 7 years ago)
- Last Synced: 2025-01-11T09:41:32.331Z (7 days ago)
- Topics: restify, restify-errors, restify-errors-options, restify-errors-options-errno
- Language: JavaScript
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# restify-errors-options-errno
[![Travis CI](https://travis-ci.org/simonepri/restify-errors-options-errno.svg?branch=master)](https://travis-ci.org/simonepri/restify-errors-options-errno) [![Codecov](https://img.shields.io/codecov/c/github/simonepri/restify-errors-options-errno/master.svg)](https://codecov.io/gh/simonepri/restify-errors-options-errno) [![npm](https://img.shields.io/npm/dm/restify-errors-options-errno.svg)](https://www.npmjs.com/package/restify-errors-options-errno) [![npm version](https://img.shields.io/npm/v/restify-errors-options-errno.svg)](https://www.npmjs.com/package/restify-errors-options-errno) [![npm dependencies](https://david-dm.org/simonepri/restify-errors-options-errno.svg)](https://david-dm.org/simonepri/restify-errors-options-errno) [![npm dev dependencies](https://david-dm.org/simonepri/restify-errors-options-errno/dev-status.svg)](https://david-dm.org/simonepri/restify-errors-options-errno#info=devDependencies)
> 🐛 Add errno to Restify's errors!Based on [restify-errors-options](https://github.com/simonepri/restify-errors-options)
DEPRECATED!!!
## Install
```
$ npm install --save restify-errors-options-errno
```## Usage
```js
const restifyErrorOtionsErrno = require('restify-errors-options-errno');
// Is extremely important to require restify-errors-options-errno before restify.
const restify = require('restify');restifyErrorOtionsErrno.install();
var server = restify.createServer();server.on('MethodNotAllowed', (req, res, err, cb) => {
console.log(err.body.errno);
//=> 'MNAE'
cb();
});const err = new restify.errors.MethodNotAllowedError({errno: '42'}});
console.log(err.toJSON());
//=> {code: 'MethodNotAllowed', message: '', errno: '42'}
```## Authors
* **Simone Primarosa** - [simonepri](https://github.com/simonepri)See also the list of [contributors](https://github.com/simonepri/restify-errors-options-errno/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.