Add better error stacks to the log

This commit is contained in:
Rowan Manning
2013-09-27 15:24:48 +01:00
parent c3e3b74bef
commit 0a637752e3
2 changed files with 8 additions and 3 deletions

3
app.js
View File

@@ -65,6 +65,9 @@ function initApp (config, callback) {
});
app.express.use(function (err, req, res, next) {
/* jshint unused: false */
if (err.code === 'ECONNREFUSED') {
err = new Error('Could not connect to pa11y-webservice');
}
app.emit('route-error', err);
if (process.env.NODE_ENV !== 'production') {
res.locals.error = err;