From 868d02d6c65eb72da9013ab6c00d04a988d3a776 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Wed, 14 Aug 2019 14:01:29 -0700 Subject: [PATCH] Added better error reporting for print-warnings errors (#16394) --- scripts/print-warnings/print-warnings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/print-warnings/print-warnings.js b/scripts/print-warnings/print-warnings.js index acc51de82465f..5da79068ede1d 100644 --- a/scripts/print-warnings/print-warnings.js +++ b/scripts/print-warnings/print-warnings.js @@ -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) {