mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-13 02:21:10 +03:00
fix(platform): properly handle websocket error events (#967)
This commit is contained in:
parent
fbce2908ad
commit
d26f47bb3b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user