From e5eafb532492c105d20ae0adf578e546ac00f403 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Tue, 8 Aug 2023 15:01:15 +0200 Subject: [PATCH] fix https://github.com/dotnet/runtime/issues/89425 ? --- src/mono/wasm/runtime/web-socket.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/runtime/web-socket.ts b/src/mono/wasm/runtime/web-socket.ts index 7d25310d4f951..7469d27cd7501 100644 --- a/src/mono/wasm/runtime/web-socket.ts +++ b/src/mono/wasm/runtime/web-socket.ts @@ -201,8 +201,12 @@ export function ws_wasm_abort(ws: WebSocketExtension): void { // cleanup the delegate proxy ws[wasm_ws_on_closed]?.dispose(); - // this is different from Managed implementation - ws.close(1000, "Connection was aborted."); + try { + // this is different from Managed implementation + ws.close(1000, "Connection was aborted."); + } catch (error) { + mono_log_warn("WebSocket error while aborting", error); + } } function reject_promises(ws: WebSocketExtension, error: Error) {