1.0.8 • Published 7 years ago

errorhandler-express v1.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

errorhandler-express

An express middleware module to generate HTTP responses on error.

TODO: Pending add more checks, test and documentation

Installation

The best way to install it is using npm

npm install errorhandler-express --save

Loading

var apiSetter = require('errorhandler-express');

Initialization and Usage

Basic usage (you can see how works better with test:

    app = express();
    var options = {
        errors : {
            app : {
                user : {
                    myOwnError : {
                        status : 401,
                        msg : "you can't see me"
                    }
                }
            }
        }
    };
    var kError = require('../index')(options);

    app.get('/error1', function (req, res, next) {
        next(kError.createError("http.badRequest"));
    });

    app.get('/error2', function (req, res, next) {
        next(kError.createError("app.user.myOwnError", {detail: new Date()}));
    });


    app.use(kError.errorHandling)

Support

This plugin is proudly supported by Kubide hi@kubide.es

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.3-k

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago