From 200145a09a51e96298f1ecd5ce78f75c27c7880a Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 11 Sep 2024 19:19:02 +0900 Subject: fix(ext/node): avoid showing `UNKNOWN` error from TCP handle (#25550) --- ext/node/polyfills/internal_binding/stream_wrap.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/node/polyfills/internal_binding/stream_wrap.ts b/ext/node/polyfills/internal_binding/stream_wrap.ts index dc30bfdfe..7aea83d6f 100644 --- a/ext/node/polyfills/internal_binding/stream_wrap.ts +++ b/ext/node/polyfills/internal_binding/stream_wrap.ts @@ -38,6 +38,7 @@ import { TextEncoder } from "ext:deno_web/08_text_encoding.js"; import { Buffer } from "node:buffer"; import { notImplemented } from "ext:deno_node/_utils.ts"; import { HandleWrap } from "ext:deno_node/internal_binding/handle_wrap.ts"; +import { ownerSymbol } from "ext:deno_node/internal/async_hooks.ts"; import { AsyncWrap, providerType, @@ -343,7 +344,8 @@ export class LibuvStreamWrap extends HandleWrap { ) { nread = codeMap.get("ECONNRESET")!; } else { - nread = codeMap.get("UNKNOWN")!; + this[ownerSymbol].destroy(e); + return; } } -- cgit v1.2.3