From 1a69df1cd7702078805a1bf63bfdc5a8453243c0 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 12 Aug 2024 23:04:12 -0500 Subject: [PATCH] Add timeout message to the relay --- src/controllers/nostr/relay.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/nostr/relay.ts b/src/controllers/nostr/relay.ts index bed6453f..583fd153 100644 --- a/src/controllers/nostr/relay.ts +++ b/src/controllers/nostr/relay.ts @@ -106,6 +106,8 @@ function connectStream(socket: WebSocket, ip: string | undefined) { } catch (e) { if (e instanceof RelayError) { send(['CLOSED', subId, e.message]); + } else if (e.message.includes('timeout')) { + send(['CLOSED', subId, 'error: the relay could not respond fast enough']); } else { send(['CLOSED', subId, 'error: something went wrong']); }