From 3f373b48e6f4ec8b4ec74ba78851ceb1ecd57e76 Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Fri, 19 Jul 2024 22:21:35 -0500 Subject: [PATCH] Fix error propagation for attachment streams Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> --- app/attachment_channel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/attachment_channel.ts b/app/attachment_channel.ts index 550415f43f..2eeba87693 100644 --- a/app/attachment_channel.ts +++ b/app/attachment_channel.ts @@ -351,7 +351,7 @@ export async function handleAttachmentRequest(req: Request): Promise { plaintext ); } catch (error) { - plaintext.emit('error', error); + plaintext.destroy(error); // These errors happen when canceling fetch from `attachment://` urls, // ignore them to avoid noise in the logs. @@ -469,7 +469,7 @@ function handleRangeRequest({ try { await pipeline(plaintext, transform); } catch (error) { - transform.emit('error', error); + transform.destroy(error); // These errors happen when canceling fetch from `attachment://` urls, // ignore them to avoid noise in the logs.