0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-17 23:45:29 -05:00

fixing bug with error handling

This commit is contained in:
Alex Kocharin 2013-09-25 12:10:59 +04:00
parent 9374872a64
commit fa1c4f30ee

View file

@ -199,9 +199,9 @@ module.exports = function(config_hash) {
app.use(app.router);
app.use(function(err, req, res, next) {
if (err.status && err.msg && err.status >= 400 && err.status < 600) {
if (err.status && err.status >= 400 && err.status < 600) {
res.status(err.status);
res.send({error: err.msg});
res.send({error: err.msg || err.message || 'unknown error'});
} else {
console.log(err);
console.log(err.stack);