mirror of https://github.com/embarklabs/embark.git
always show process messages if error and catch geth errors
This commit is contained in:
parent
4815555a89
commit
1bca31184e
|
@ -112,12 +112,20 @@ Blockchain.prototype.run = function() {
|
|||
});
|
||||
if (self.onReadyCallback) {
|
||||
// Geth logs appear in stderr somehow
|
||||
let lastMessage;
|
||||
child.stderr.on('data', (data) => {
|
||||
if (!self.readyCalled && data.indexOf('Mapped network port') > -1) {
|
||||
self.readyCalled = true;
|
||||
return self.onReadyCallback();
|
||||
self.onReadyCallback();
|
||||
}
|
||||
lastMessage = data;
|
||||
console.log('Geth: ' + data);
|
||||
});
|
||||
child.on('exit', (code) => {
|
||||
if (code) {
|
||||
console.error('Geth exited with error code ' + 1);
|
||||
console.error(lastMessage);
|
||||
}
|
||||
console.log('Geth:' + data);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -36,11 +36,15 @@ class ProcessLauncher {
|
|||
}
|
||||
self._checkSubscriptions(msg);
|
||||
});
|
||||
|
||||
this.process.on('exit', (code) => {
|
||||
self.logger.info('Process exited with code ' + code);
|
||||
});
|
||||
}
|
||||
|
||||
// Translates logs from the child process to the logger
|
||||
_handleLog(msg) {
|
||||
if (this.silent) {
|
||||
if (this.silent && msg.type !== 'error') {
|
||||
return;
|
||||
}
|
||||
if (this.logger[msg.type]) {
|
||||
|
|
|
@ -20,8 +20,7 @@ class BlockchainProcessLauncher {
|
|||
logger: this.logger,
|
||||
events: this.events,
|
||||
normalizeInput: this.normalizeInput,
|
||||
//silent: true
|
||||
silent: false
|
||||
silent: true
|
||||
});
|
||||
this.blockchainProcess.send({
|
||||
action: constants.blockchain.init, options: {
|
||||
|
|
Loading…
Reference in New Issue