mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Adds an immediate catch to the _send promise passed to _whenReady in case there is rejection before async handlers are added
This commit is contained in:
@@ -382,6 +382,7 @@ class Connection extends EventEmitter {
|
||||
|
||||
_whenReady<T>(promise: Promise<T>): Promise<T> {
|
||||
return new Promise((resolve, reject) => {
|
||||
promise.catch(reject);
|
||||
if (!this._shouldBeConnected) {
|
||||
reject(new NotConnectedError())
|
||||
} else if (this._state === WebSocket.OPEN && this._isReady) {
|
||||
|
||||
Reference in New Issue
Block a user