Housekeeping

This commit is contained in:
SukkaW
2024-11-30 13:12:15 +08:00
parent 4723397cd0
commit 1c724520f7
4 changed files with 136 additions and 174 deletions

View File

@@ -1,13 +0,0 @@
diff --git a/lib/api/api-request.js b/lib/api/api-request.js
index ced5590d21053ddd4c6e81e25fb1a3baea08e2c5..be17d62877403cfc8afe10a75ceb67bf1de5e56d 100644
--- a/lib/api/api-request.js
+++ b/lib/api/api-request.js
@@ -73,7 +73,7 @@ class RequestHandler extends AsyncResource {
this.removeAbortListener = util.addAbortListener(this.signal, () => {
this.reason = this.signal.reason ?? new RequestAbortedError()
if (this.res) {
- util.destroy(this.res, this.reason)
+ util.destroy(this.res.on('error', util.nop), this.reason)
} else if (this.abort) {
this.abort(this.reason)
}