diff options
| author | Egor Tensin <egor@tensin.name> | 2026-02-28 21:59:12 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-02-28 22:19:57 +0100 |
| commit | 9611c248995ad3bacda1d0a93d0b5e1e6605d162 (patch) | |
| tree | eb3ae35b426e9d72e7cb34e8e9cc0453745a8e17 /node_modules/undici/lib/api/api-pipeline.js | |
| parent | DEVELOPMENT.md: expand on sources (diff) | |
| download | cleanup-path-9611c248995ad3bacda1d0a93d0b5e1e6605d162.tar.gz cleanup-path-9611c248995ad3bacda1d0a93d0b5e1e6605d162.zip | |
upgrade actions/core to version 2
Diffstat (limited to 'node_modules/undici/lib/api/api-pipeline.js')
| -rw-r--r-- | node_modules/undici/lib/api/api-pipeline.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/node_modules/undici/lib/api/api-pipeline.js b/node_modules/undici/lib/api/api-pipeline.js index af4a180..e64b329 100644 --- a/node_modules/undici/lib/api/api-pipeline.js +++ b/node_modules/undici/lib/api/api-pipeline.js @@ -4,16 +4,16 @@ const { Readable, Duplex, PassThrough -} = require('stream') +} = require('node:stream') const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require('../core/errors') const util = require('../core/util') -const { AsyncResource } = require('async_hooks') +const { AsyncResource } = require('node:async_hooks') const { addSignal, removeSignal } = require('./abort-signal') -const assert = require('assert') +const assert = require('node:assert') const kResume = Symbol('resume') @@ -100,7 +100,7 @@ class PipelineHandler extends AsyncResource { read: () => { const { body } = this - if (body && body.resume) { + if (body?.resume) { body.resume() } }, @@ -147,12 +147,14 @@ class PipelineHandler extends AsyncResource { onConnect (abort, context) { const { ret, res } = this - assert(!res, 'pipeline cannot be retried') - - if (ret.destroyed) { - throw new RequestAbortedError() + if (this.reason) { + abort(this.reason) + return } + assert(!res, 'pipeline cannot be retried') + assert(!ret.destroyed) + this.abort = abort this.context = context } |
