Skip to content

Commit

Permalink
Default errors to 400
Browse files Browse the repository at this point in the history
  • Loading branch information
cvasseng committed Nov 12, 2024
1 parent 76c0b2f commit 6b0a715
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/server/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const logErrorMiddleware = (error, req, res, next) => {
const returnErrorMiddleware = (error, req, res, next) => {
// Gather all requied information for the response
const { statusCode: stCode, status, message, stack } = error;
const statusCode = stCode || status || 500;
const statusCode = stCode || status || 400;

// Set and return response
res.status(statusCode).json({ statusCode, message, stack });
Expand Down

0 comments on commit 6b0a715

Please sign in to comment.