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
This commit is contained in:
Owen W. Taylor 2014-05-19 21:34:04 -04:00
parent b95c0682b0
commit 910c95fa9b

View File

@ -360,7 +360,12 @@ function runPerfScript(scriptModule, outputFile) {
_step(g, _step(g,
function() { function() {
try {
_collect(scriptModule, outputFile); _collect(scriptModule, outputFile);
} catch (err) {
log("Script failed: " + err + "\n" + err.stack);
Meta.exit(Meta.ExitCode.ERROR);
}
Meta.exit(Meta.ExitCode.SUCCESS); Meta.exit(Meta.ExitCode.SUCCESS);
}, },
function(err) { function(err) {