Socket
Socket
Sign inDemoInstall

errorhandler-express

Package Overview
Dependencies
7
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    errorhandler-express

An express middleware module to generate HTTP responses on error.


Version published
Weekly downloads
2
decreased by-86.67%
Maintainers
1
Install size
18.0 MB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 20 Apr 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc