Skip to content

Commit

Permalink
fix(platform): properly handle websocket error events (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Feb 13, 2020
1 parent fbce290 commit d26f47b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform.ts
Expand Up @@ -325,7 +325,7 @@ export class WebSocketTransport implements ConnectionTransport {
}) : new WebSocket(url)) as WebSocket;
this._connect = new Promise((fulfill, reject) => {
this._ws.addEventListener('open', () => fulfill());
this._ws.addEventListener('error', event => reject(new Error(event.toString())));
this._ws.addEventListener('error', event => reject(new Error('WebSocket error: ' + (event as ErrorEvent).message)));
});
// The 'ws' module in node sometimes sends us multiple messages in a single task.
// In Web, all IO callbacks (e.g. WebSocket callbacks)
Expand Down

0 comments on commit d26f47b

Please sign in to comment.