diff --git a/lib/Connection.js b/lib/Connection.js index e657926c..0f301d52 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -132,6 +132,8 @@ class Connection extends EventEmitter { this._closeCallback = null; } this._transport.removeAllListeners(); + // If transport throws any error at this point of time, we don't care and should swallow it. + this._transport.on('error', () => {}); for (const callback of this._callbacks.values()) callback.reject(rewriteError(callback.error, `Protocol error (${callback.method}): Target closed.`)); this._callbacks.clear();