From 5220df7a222280ea5240f48f8f06260ad4bfb615 Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Wed, 20 Sep 2023 14:20:54 -0300 Subject: [PATCH] fix: reject createClientTransport promise if socket is closed --- packages/@dcl/sdk/src/network-transport/client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/@dcl/sdk/src/network-transport/client.ts b/packages/@dcl/sdk/src/network-transport/client.ts index c4f25dcce..9a41ed8ad 100644 --- a/packages/@dcl/sdk/src/network-transport/client.ts +++ b/packages/@dcl/sdk/src/network-transport/client.ts @@ -67,6 +67,9 @@ export async function createClientTransport({ serverUrl }: ClientTransportConfig console.error(e) reject(e) } + ws.onclose = () => { + reject(new Error('socket closed')) + } } catch (err) { reject(err) }