mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Merge pull request #1092 from nickewansmith/fix-unhandled-rejection-warning-on-send
Fix Unhandled Promise Rejection Warning on message _send
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