Skip to content

Commit abdda22

Browse files
committed
fix(cloudflare): ignore errors when the stream is already closed
1 parent 596587f commit abdda22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/open-next/src/overrides/wrappers/cloudflare-node.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ const handler: WrapperHandler<InternalEvent, InternalResult> =
9494
if (error) {
9595
controller.error(error);
9696
} else {
97-
controller.close();
97+
try {
98+
controller.close();
99+
} catch {
100+
// Ignore "This ReadableStream is closed"
101+
}
98102
}
99103
callback(error);
100104
},

0 commit comments

Comments
 (0)