diff --git a/js/ui/scripting.js b/js/ui/scripting.js index 1da99d977..72f670261 100644 --- a/js/ui/scripting.js +++ b/js/ui/scripting.js @@ -360,7 +360,12 @@ function runPerfScript(scriptModule, outputFile) { _step(g, function() { - _collect(scriptModule, outputFile); + try { + _collect(scriptModule, outputFile); + } catch (err) { + log("Script failed: " + err + "\n" + err.stack); + Meta.exit(Meta.ExitCode.ERROR); + } Meta.exit(Meta.ExitCode.SUCCESS); }, function(err) {