1.0.0 • Published 8 years ago

domain-helper v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

domain-helper

domain-helper is a express middleware for handling uncaughtException.

Installation

$ npm install --save domain-helper

Usage

Basic usage example:

var express = require('express');
var domainHelper  = require('domain-helper');

var app = express();
app.use(domainHelper.middleware({
    maxTimes: 3,
    errorHandler: function(err){
        console.log('=== errorHandler ===', err.stack);
    }
}));

API

middleware(opts)

The following are the options that can be passed to middleware.

KeyDescription
errorHandlerWhat to do when exception occurs.
maxTimesThe max times which exception occurs and it will exec process.exit(1).

License

MIT