Browse Source

agent: implement debugging support

master
Guillermo Rauch 9 years ago
parent
commit
d78fa92d74
  1. 6
      lib/agent.js

6
lib/agent.js

@ -13,7 +13,7 @@ import fetch from 'node-fetch';
*/ */
export default class Agent { export default class Agent {
constructor (host, { debug }) { constructor (host, { debug } = {}) {
this._host = host; this._host = host;
this._debug = debug; this._debug = debug;
this._initAgent(); this._initAgent();
@ -28,7 +28,9 @@ export default class Agent {
_onError (err) { _onError (err) {
// XXX: should we `this.emit()`? // XXX: should we `this.emit()`?
if (this._debug) console.log('> [debug] connection error', err.stack); if (this._debug) {
console.log('> [debug] agent connection error', err.stack);
}
this._error = err; this._error = err;
} }

Loading…
Cancel
Save