Skip to content

Commit

Permalink
Added better error reporting for print-warnings errors (#16394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn authored Aug 14, 2019
1 parent 4ba1412 commit 868d02d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/print-warnings/print-warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ function transform(file, enc, cb) {
return;
}

const ast = babylon.parse(source, babylonOptions);
let ast;
try {
ast = babylon.parse(source, babylonOptions);
} catch (error) {
console.error('Failed to parse source file:', file.path);
throw error;
}

traverse(ast, {
CallExpression: {
exit: function(astPath) {
Expand Down

0 comments on commit 868d02d

Please sign in to comment.