Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 868d02d

Browse files
author
Brian Vaughn
authored
Added better error reporting for print-warnings errors (facebook#16394)
1 parent 4ba1412 commit 868d02d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/print-warnings/print-warnings.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ function transform(file, enc, cb) {
3838
return;
3939
}
4040

41-
const ast = babylon.parse(source, babylonOptions);
41+
let ast;
42+
try {
43+
ast = babylon.parse(source, babylonOptions);
44+
} catch (error) {
45+
console.error('Failed to parse source file:', file.path);
46+
throw error;
47+
}
48+
4249
traverse(ast, {
4350
CallExpression: {
4451
exit: function(astPath) {

0 commit comments

Comments
 (0)