Skip to content

Commit

Permalink
Revert "fix: handle unhandled exception at handleErrors"
Browse files Browse the repository at this point in the history
This reverts commit 598c10c.
  • Loading branch information
barisusakli committed May 23, 2024
1 parent db30834 commit 285e40a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/controllers/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,10 @@ exports.handleErrors = async function handleErrors(err, req, res, next) { // esl
try {
if (data.cases.hasOwnProperty(err.code)) {
data.cases[err.code](err, req, res, defaultHandler);
} else if (err.message) {
if (err.message.startsWith('[[error:no-') && err.message !== '[[error:no-privileges]]') {
notFoundHandler();
} else if (err.message.startsWith('Failed to lookup view')) {
notBuiltHandler();
}
} else if (err.message.startsWith('[[error:no-') && err.message !== '[[error:no-privileges]]') {
notFoundHandler();
} else if (err.message.startsWith('Failed to lookup view')) {
notBuiltHandler();
} else {
await defaultHandler();
}
Expand Down

0 comments on commit 285e40a

Please sign in to comment.