Browse Source

build-logger: handle socket errors better

master
Guillermo Rauch 9 years ago
parent
commit
14be7dd818
  1. 9
      lib/build-logger.js

9
lib/build-logger.js

@ -8,6 +8,7 @@ export default class Logger extends EventEmitter {
constructor (host, { debug = false, quiet = false } = {}) {
super();
this.host = host;
this.debug = debug;
this.quiet = quiet;
// readyState
@ -84,10 +85,10 @@ export default class Logger extends EventEmitter {
this.emit('close');
}
onSocketError () {
this.removeAllListeners();
console.error('> Connection error');
this.emit('error');
onSocketError (err) {
if (this.debug) {
console.log('> [debug] Socket error', err.stack);
}
}
}

Loading…
Cancel
Save