Fix error propagation for attachment streams
This commit is contained in:
parent
1fd8b0ef23
commit
b8ef9e5cbc
1 changed files with 2 additions and 2 deletions
|
@ -351,7 +351,7 @@ export async function handleAttachmentRequest(req: Request): Promise<Response> {
|
|||
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.
|
||||
|
|
Loading…
Reference in a new issue