Skip to content

Commit

Permalink
Merge pull request #1117 from qoomon/patch-1
Browse files Browse the repository at this point in the history
fix(http-error-handler): non http errors will always be handled
  • Loading branch information
willfarrell committed Nov 8, 2023
2 parents ded7a13 + 4c99241 commit b843f9d
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) {
request.error = {
statusCode: 500,
message: options.fallbackMessage,
message: options.fallbackMessage || 'Internal Server Error',
expose: true
}
}
Expand Down

0 comments on commit b843f9d

Please sign in to comment.