From 910c95fa9bab1183edf88e605cdee6e46a7dfbf3 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 19 May 2014 21:34:04 -0400 Subject: [PATCH] Scripting: exit if the perf script throws an error during collection If an exception occurs while collecting parameters, exit rather than just leaving the shell running in the main loop. https://bugzilla.gnome.org/show_bug.cgi?id=732349 --- js/ui/scripting.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) {