From d8dbeedcc2bf42350ba2da86d164fc0273225484 Mon Sep 17 00:00:00 2001 From: Nicholas Smith Date: Wed, 13 Nov 2019 01:24:09 -0500 Subject: [PATCH] Adds an immediate catch to the _send promise passed to _whenReady in case there is rejection before async handlers are added --- src/common/connection.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/connection.ts b/src/common/connection.ts index 66d431f8..2cbe8f87 100644 --- a/src/common/connection.ts +++ b/src/common/connection.ts @@ -382,6 +382,7 @@ class Connection extends EventEmitter { _whenReady(promise: Promise): Promise { return new Promise((resolve, reject) => { + promise.catch(reject); if (!this._shouldBeConnected) { reject(new NotConnectedError()) } else if (this._state === WebSocket.OPEN && this._isReady) {