drmrbrewer
drmrbrewer

Reputation: 13009

Default error handler for node express

I've read the error handling guidance given for the express module, but would like to dig a little deeper and see exactly what the default error handler in express actually does (and hence what my custom error handler should and shouldn't do, if it can pass on some of the basic error handling procedure on to the default handler). It may just be showing my ignorance, but I can't for the life of me find where the default error handler is actually defined in the express source code. Please can someone help me out here.

Upvotes: 2

Views: 3888

Answers (1)

Paul
Paul

Reputation: 36329

Pretty sure the default handler just logs to stderr. Look at the logerror function and how it's used in the "finalhandler".

https://github.com/expressjs/express/blob/master/lib/application.js

Upvotes: 2

Related Questions