From c9f9080369ceb2c99e787d1a15389f3c810f7f3d Mon Sep 17 00:00:00 2001 From: Alan Lu Date: Fri, 14 Jul 2017 08:35:55 -0500 Subject: [PATCH] More informative TestRPC failure logging --- bin/exec.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/exec.js b/bin/exec.js index d9ea9f5..f005c34 100644 --- a/bin/exec.js +++ b/bin/exec.js @@ -154,8 +154,12 @@ new Promise((resolve, reject) => { const testrpcOptions = config.testrpcOptions || defaultRpcOptions; const command = './node_modules/ethereumjs-testrpc-sc/bin/testrpc '; - testrpcProcess = childprocess.exec(command + testrpcOptions, null, err => { - if (err) cleanUp('testRpc errored after launching as a childprocess.'); + testrpcProcess = childprocess.exec(command + testrpcOptions, null, (err, stdout, stderr) => { + if (err) { + if(stdout) log(`testRpc stdout:\n${stdout}`); + if(stderr) log(`testRpc stderr:\n${stderr}`); + cleanUp('testRpc errored after launching as a childprocess.'); + } }); testrpcProcess.stdout.on('data', data => { if (data.includes('Listening')) {