Skip to content

Commit

Permalink
Make mongoose errors non-operational
Browse files Browse the repository at this point in the history
  • Loading branch information
hagopj13 committed Dec 24, 2020
1 parent a37d572 commit ea4f1c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const errorConverter = (err, req, res, next) => {
const statusCode =
error.statusCode || error instanceof mongoose.Error ? httpStatus.BAD_REQUEST : httpStatus.INTERNAL_SERVER_ERROR;
const message = error.message || httpStatus[statusCode];
error = new ApiError(statusCode, message, !(statusCode === httpStatus.INTERNAL_SERVER_ERROR), err.stack);
error = new ApiError(statusCode, message, false, err.stack);
}
next(error);
};
Expand Down

0 comments on commit ea4f1c5

Please sign in to comment.