Neverending Puppy Marathon

    This package has been deprecated

    Author message:

    This package is unmaintained and may not works for version of restify > 5.0.1 and restify-errors > 4.3.0. Please see https://github.com/restify/errors#customizing-errors

    restify-errors-options-errno

    0.1.2 • Public • Published

    restify-errors-options-errno

    Travis CI Codecov npm npm version npm dependencies npm dev dependencies

    🐛 Add errno to Restify's errors!

    Based on restify-errors-options


    DEPRECATED!!!


    Install

    $ npm install --save restify-errors-options-errno
    

    Usage

    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

    See also the list of contributors who participated in this project.

    License

    This project is licensed under the MIT License - see the LICENSE file for details.

    Install

    npm i restify-errors-options-errno

    DownloadsWeekly Downloads

    8

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    4.97 kB

    Total Files

    4

    Last publish

    Collaborators

    • simonepri