0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

dealing with internal errors in express.js

This commit is contained in:
Alex Kocharin 2013-12-05 16:31:21 +04:00
parent 7b0ab14d4c
commit 9ee8d484db

View file

@ -49,6 +49,10 @@ module.exports = function(config_hash) {
}
} else {
Logger.logger.error({err: err}, 'unexpected error: @{!err.message}\n@{err.stack}')
if (!res.status || !res.send) {
Logger.logger.error('this is an error in express.js, please report this')
res.destroy()
}
if (calls == 1) {
res.status(500)
res.send({error: 'internal server error'})