Skip to content

Commit

Permalink
wrap setting err.message with a try/catch (#2996)
Browse files Browse the repository at this point in the history
  • Loading branch information
chharvey committed May 1, 2020
1 parent c99cb3c commit b043d7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/pug-runtime/index.js
Expand Up @@ -248,7 +248,9 @@ function pug_rethrow(err, filename, lineno, str){

// Alter exception message
err.path = filename;
err.message = (filename || 'Pug') + ':' + lineno
+ '\n' + context + '\n\n' + err.message;
try {
err.message = (filename || 'Pug') + ':' + lineno
+ '\n' + context + '\n\n' + err.message;
} catch (e) {}
throw err;
};

0 comments on commit b043d7c

Please sign in to comment.