Nop
Nop5w ago

QUIC QuicReceiveStream read() panics when peer disconnects

Deno panics when I'm waiting for a stream after the peer has disconnected. The panic cannot be caught with a try/catch. Code:
const reader = (await conn.incomingUnidirectionalStreams.getReader().read()).value.getReader();
while(true) {
try {
const msg = await reader.read();
}catch(e) {
console.error(e);
}
}
const reader = (await conn.incomingUnidirectionalStreams.getReader().read()).value.getReader();
while(true) {
try {
const msg = await reader.read();
}catch(e) {
console.error(e);
}
}
Output:
NotConnected: connection lost
at async Object.pull (ext:deno_web/06_streams.js:941:27) {
name: "NotConnected",
code: "ENOTCONN"
}
error: Uncaught (in promise) Error: timed out
NotConnected: connection lost
at async Object.pull (ext:deno_web/06_streams.js:941:27) {
name: "NotConnected",
code: "ENOTCONN"
}
error: Uncaught (in promise) Error: timed out
Many thanks in advance. I really appreciate the new feature!
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?