We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea29487 commit f9274e1Copy full SHA for f9274e1
lib/transports/websocket.js
@@ -96,7 +96,11 @@ WS.prototype.doOpen = function () {
96
opts.headers = this.extraHeaders;
97
}
98
99
- this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
+ try {
100
+ this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
101
+ } catch (err) {
102
+ return this.emit('error', err)
103
+ }
104
105
if (this.ws.binaryType === undefined) {
106
this.supportsBinary = false;
0 commit comments