From 642941beeaad06603b6c6289133500d205d591d4 Mon Sep 17 00:00:00 2001 From: greper Date: Wed, 4 Jun 2025 13:14:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dgetaddrinfo=20ENOTFOUN?= =?UTF-8?q?D=20=E6=8A=A5=E9=94=99=E6=97=B6=20request=E7=9A=84promise?= =?UTF-8?q?=E6=B0=B8=E8=BF=9C=E4=B8=8D=E4=BC=9A=E7=BB=93=E6=9D=9F=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index b2795b9..b960276 100644 --- a/src/index.js +++ b/src/index.js @@ -333,6 +333,11 @@ class PveClientBase { reject(error); }); }); + // 处理req的error,比如 getaddrinfo ENOTFOUND , 否则永远不会结束promise + req.on("error", (error) => { + this.#error(error); + reject(error); + }); if (body != "") { req.write(body);