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:
parent
9374872a64
commit
fa1c4f30ee
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue