From 753ff323ea540a1a8b300609a0b1d9f83b61f336 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 6 Jun 2024 15:32:26 -0300 Subject: [PATCH] specify websocket error as close reason when no message is available. fixes https://github.com/nbd-wtf/nostr-tools/issues/411 --- abstract-relay.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abstract-relay.ts b/abstract-relay.ts index 69a2306..015b457 100644 --- a/abstract-relay.ts +++ b/abstract-relay.ts @@ -98,7 +98,7 @@ export class AbstractRelay { } this.ws.onerror = ev => { - reject((ev as any).message) + reject((ev as any).message || 'websocket error') if (this._connected) { this._connected = false this.connectionPromise = undefined