diff --git a/lib/processes/storageProcesses/ipfs.js b/lib/processes/storageProcesses/ipfs.js index 8093584e..f50cdc42 100644 --- a/lib/processes/storageProcesses/ipfs.js +++ b/lib/processes/storageProcesses/ipfs.js @@ -33,7 +33,17 @@ class IPFSProcess extends ProcessWrapper { const self = this; const child = child_process.spawn('ipfs', ['daemon']); let lastMessage; + + child.on('error', (err) => { + err = err.toString(); + console.error('IPFS error: ', err); + }); + child.stderr.on('data', (data) => { + data = data.toString(); + console.log(`IPFS error: ${data}`); + }); child.stdout.on('data', (data) => { + data = data.toString(); if (!self.readyCalled && data.indexOf('Daemon is ready') > -1) { self.readyCalled = true; self.send({result: constants.storage.initiated}); @@ -44,7 +54,9 @@ class IPFSProcess extends ProcessWrapper { child.on('exit', (code) => { if (code) { console.error('IPFS exited with error code ' + code); - console.error(lastMessage); + if (lastMessage) { + console.error(lastMessage); + } } }); }