From e9d29075ebfd136f135c5f1013257a97949c88d9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 2 Feb 2024 14:51:22 -0600 Subject: [PATCH] pipeline: catch error on broadcast --- src/pipeline.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pipeline.ts b/src/pipeline.ts index 86885eb..f326258 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -225,11 +225,15 @@ function streamOut(event: NostrEvent) { * Publish the event to other relays. * This should only be done in certain circumstances, like mentioning a user or publishing deletions. */ -function broadcast(event: DittoEvent, signal: AbortSignal) { +async function broadcast(event: DittoEvent, signal: AbortSignal) { if (!event.user || !isFresh(event)) return; if (event.kind === 5) { - client.event(event, { signal }); + try { + await client.event(event, { signal }); + } catch (e) { + debug(e); + } } }