diff --git a/app/modules/ws2p/lib/WS2PClient.ts b/app/modules/ws2p/lib/WS2PClient.ts index 00df5c150aa8b85c13020b1694f4d0e3bbbdcbb9..a3e599eba9d94f1d557ee8bd10c8fe7172272f29 100644 --- a/app/modules/ws2p/lib/WS2PClient.ts +++ b/app/modules/ws2p/lib/WS2PClient.ts @@ -36,7 +36,13 @@ export class WS2PClient { }) // Connecting - await c.connect() + try { + await c.connect() + } catch (e) { + // Immediately close the connection + c.close() + throw e + } return new WS2PClient(c) } } \ No newline at end of file