bragg icon indicating copy to clipboard operation
bragg copied to clipboard

Emit events on error

Open SamVerschueren opened this issue 9 years ago • 0 comments

At this moment, the errors are always logged and the stack trace is logged if error.expose is false. https://github.com/SamVerschueren/bragg/blob/master/context.js#L28-L32

Instead, we should use the EventEmitter and let the user subscribe on error events and let them handle the logging.

var bragg = require('bragg');

var app = bragg();

app.on('error', function (err) {
    console.log(err);
});

SamVerschueren avatar Feb 12 '16 11:02 SamVerschueren