From 1dba9d2d0740ec8472ce8661df7ed907e30ce643 Mon Sep 17 00:00:00 2001 From: Jonathan Lee Date: Mon, 31 Oct 2016 00:46:42 -0400 Subject: [PATCH] Catching exit code from browsertime and exiting if non-zero is returned #1267 --- lib/plugins/browsertime/analyzer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/plugins/browsertime/analyzer.js b/lib/plugins/browsertime/analyzer.js index 92838198c1..a83f9cbe15 100644 --- a/lib/plugins/browsertime/analyzer.js +++ b/lib/plugins/browsertime/analyzer.js @@ -73,7 +73,11 @@ module.exports = { let engine = new browsertime.Engine(btOptions); log.info('Starting %s for analysing %s %s time(s)', btOptions.browser, url, btOptions.iterations); return engine.start() - .then(() => engine.run(url, scriptsByCategory)) + .then((result,error) => engine.run(url, scriptsByCategory)) + .catch((error) => { + process.exitCode = 1; + process.exit(); + }) .finally(() => engine.stop()) } };