Skip to content

Commit

Permalink
Removed overly-specific handling of handlebars errors
Browse files Browse the repository at this point in the history
refs: #10496
refs: handlebars-lang/handlebars.js#1548

- For a while, handlebars would and could generate quite a lot of obscure sytnax error messages for malformed helpers that we couldn't catch in gscan
- This was fixed in handlebars-lang/handlebars.js#1548
- We have also since added AST parsing to gscan, so if there are more obscure syntax errors, we should be able to add rules to catch them
- Therefore, this additional, overly specific code block isn't needed anymore, so let's clean it up!
  • Loading branch information
ErisDS committed Nov 25, 2021
1 parent 3315ed3 commit 303ea87
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions core/server/web/shared/middleware/error-handler.js
Expand Up @@ -105,14 +105,6 @@ _private.prepareError = (err, req, res, next) => {
err = new errors.NotFoundError({
err: err
});
} else if (err.stack.match(/node_modules\/handlebars\//)) {
// Temporary handling of theme errors from handlebars
// @TODO remove this when #10496 is solved properly
err = new errors.IncorrectUsageError({
err: err,
message: err.message,
statusCode: err.statusCode
});
} else {
err = new errors.GhostError({
err: err,
Expand Down

0 comments on commit 303ea87

Please sign in to comment.