|
|
@ -13,7 +13,7 @@ import fetch from 'node-fetch'; |
|
|
|
*/ |
|
|
|
|
|
|
|
export default class Agent { |
|
|
|
constructor (host, { debug }) { |
|
|
|
constructor (host, { debug } = {}) { |
|
|
|
this._host = host; |
|
|
|
this._debug = debug; |
|
|
|
this._initAgent(); |
|
|
@ -28,7 +28,9 @@ export default class Agent { |
|
|
|
|
|
|
|
_onError (err) { |
|
|
|
// 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; |
|
|
|
} |
|
|
|
|
|
|
|