I've encountered problems whilst attempting to stream Responses, and discovered that if an error is thrown within the stream it just seems to be completely swallowed.
Here's a simple example:
#!/usr/bin/env -S deno run --allow-net --watchawait Deno.serve(() => { return new Response(ReadableStream.from(content()));}).finished;// deno-lint-ignore require-yieldfunction* content() { throw new Error("EPIC FAIL");}
#!/usr/bin/env -S deno run --allow-net --watchawait Deno.serve(() => { return new Response(ReadableStream.from(content()));}).finished;// deno-lint-ignore require-yieldfunction* content() { throw new Error("EPIC FAIL");}
Hit the server and the request fails, but no errors are logged.
Is there a preferred way to handle the errors in a stream? Or this is a bug in Deno? IMHO it feels like one, I wouldn't expects errors to just silently vanish like this.