From 5327f8da4ea1676a86b53b7dbaff2c0fd4964ba9 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Mon, 29 Oct 2018 21:40:23 -0700 Subject: [PATCH] Timer script should error properly if something goes wrong, and print out what happened. --- scripts/timer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/timer.js b/scripts/timer.js index 47fb280a9..894310d6f 100755 --- a/scripts/timer.js +++ b/scripts/timer.js @@ -6,8 +6,12 @@ var fs = require('fs'); var name = process.argv[2]; var cmd = process.argv.slice(3).join(' '); var start = Date.now(); -exec(cmd, (err) => { - if (err) return console.log(err); +exec(cmd, (err, stdout, stderr) => { + if (err) { + console.log(stdout); + console.log(stderr); + return process.exit(err.code); + } var stop = +new Date(); var time = (stop - start) / 1000.; fs.appendFileSync('/tmp/osrm.timings', `${name}\t${time}`, 'utf-8');