From a7f2fb06ee11492e552d32125fe06013058daae5 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 2 Jul 2024 17:09:17 -0300 Subject: [PATCH] feat(relay): send custom error messages - since, until & kind --- src/controllers/nostr/relay.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/nostr/relay.ts b/src/controllers/nostr/relay.ts index 4d8ab2cb..4f278d64 100644 --- a/src/controllers/nostr/relay.ts +++ b/src/controllers/nostr/relay.ts @@ -77,7 +77,10 @@ function connectStream(socket: WebSocket) { send(['EVENT', subId, event]); } } catch (e) { - if (e instanceof RelayError) { + if ( + e instanceof RelayError || + e.message.slice(-('filter too far into the future'.length)) === 'filter too far into the future' + ) { send(['CLOSED', subId, e.message]); } else { send(['CLOSED', subId, 'error: something went wrong']);