-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app error handling improvements #48
Comments
how about we remove app.outputErrors (and just imply that stuff in the default handler), and make it |
something like: function App() {
this.on('error', logger);
}
App.prototype.error = function(fn){
this.removeListener('error', logger);
this.on('error', fn);
}
function logger(err) {
if ('test' != this.env) console.error(err.stack);
} i think that'll work. remember, no |
yeah I think that'll work pretty good, and we can forward mounted app errors upstream |
think im fine with this for now actually, it's easier to explain |
haha, so i thought about errors where you don't want them to be logged, but then i realized how much easier error handling will be vs express |
right now,
app.onerror
is added to the theerror
event listener automatically. what happens if users don't want to use it? doingapp.removeListener('event', app.onerror
)` is a little annoying. instead i suggest the following:app.onerror
app.outputErrors
app.callback()
stage, warn/throw if no event listeners have been addedThe text was updated successfully, but these errors were encountered: