| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 193d629 commit 03839fb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -227,7 +227,7 @@ function pipelineImpl(streams, callback, opts) { | |||
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | 229 | function finishImpl(err, final) { | |
| 230 | - if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE')) { | ||
| 230 | + if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE' || error.name === 'AbortError')) { | ||
| 231 | 231 | error = err; | |
| 232 | 232 | } | |
| 233 | 233 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1749,3 +1749,24 @@ tmpdir.refresh(); | |||
| 1749 | 1749 | assert.deepStrictEqual(err, new Error('booom')); | |
| 1750 | 1750 | })); | |
| 1751 | 1751 | } | |
| 1752 | + | ||
| 1753 | + { | ||
| 1754 | + // Errors thrown in Readable.map inside pipeline should not be | ||
| 1755 | + // swallowed by AbortError when the source is an infinite stream. | ||
| 1756 | + pipeline( | ||
| 1757 | + new Readable({ read() { this.push('data'); } }), | ||
| 1758 | + new Transform({ | ||
| 1759 | + readableObjectMode: true, | ||
| 1760 | + transform(chunk, encoding, callback) { | ||
| 1761 | + this.push({}); | ||
| 1762 | + callback(); | ||
| 1763 | + }, | ||
| 1764 | + }), | ||
| 1765 | + (readable) => readable.map(async () => { | ||
| 1766 | + throw new Error('Boom!'); | ||
| 1767 | + }), | ||
| 1768 | + common.mustCall((err) => { | ||
| 1769 | + assert.strictEqual(err.message, 'Boom!'); | ||
| 1770 | + }), | ||
| 1771 | + ); | ||
| 1772 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments