Skip to content

Commit

Permalink
fix(http-error-handler): non http errors will be handled as 'Internal…
Browse files Browse the repository at this point in the history
… Server Error'
  • Loading branch information
qoomon authored Oct 27, 2023
1 parent f6c1524 commit 504c482
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/http-error-handler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ const httpErrorHandlerMiddleware = (opts = {}) => {
}

// Non-http error OR expose set to false
if (
options.fallbackMessage &&
(!request.error.statusCode || !request.error.expose)
) {
if (!request.error.expose || !request.error.statusCode)) {

Check notice

Code scanning / CodeQL

Syntax error Note

Error: Unexpected token
request.error = {
statusCode: 500,
message: options.fallbackMessage,
message: options.fallbackMessage || 'Internal Server Error',
expose: true
}
}
Expand Down

0 comments on commit 504c482

Please sign in to comment.