0.3.2 • Published 8 years ago

debug.me v0.3.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Installation

  1. install via npm:

    npm install debug.me --save

  2. put to config/autoload.js (compoundjs only);

    require('debug.me');

Usage

var debugme = require('debug.me');

// global error hanler
debugme.registerGlobalHandler([customHandler]);
// customHandler - optional function param which called with error,
// if customHandler is not specified process will exist,
// when customHandler is specified, then it is a responsibility of
// customHandler to exit process (see example)
// customHandler called after reporting about error

// custom error reporter
var reportError = debugme.errorReporter();
reportError(new Error('Message'), function() {
    console.log('error reported');
});

// error reporter middleware for express/compound
app.use(debugme.middleware([customHandler]));
// customHandler - optional function param which called with `error` and `next`
// if customHandler is not specified next will be called inside handler
// when customHandler is specified, then it is a responsibility of
// customHandler to call `next` with error passed to it as first arguments (see example)
// customHandler called after reporting about error

Config (compound apps)

app.enable('send-errors');
app.enable('skip-global-errors');

// optionally customHandler can be specified for uncaught errors
compound.onUncaughtError = function(err) {
    compound.log(err);
    process.exit(1);
};
// and for uncaught error
compound.onCaughtError = function(err, next) {
    compound.log(err);
    next(err);
};
0.3.2

8 years ago

0.3.1

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

10 years ago

0.0.7

10 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago