-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: throw unhandled error for readable with autoDestroy
If autoDestroy then we should still throw on unhandled errors. PR-URL: #29806 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Co-Authored-By: Trivikram Kamat <trivikr.dev@gmail.com>
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const { Readable, Writable } = require('stream'); | ||
|
||
process.on('uncaughtException', common.mustCall((err) => { | ||
assert.strictEqual(err.message, 'asd'); | ||
})); | ||
|
||
const r = new Readable({ | ||
read() { | ||
this.push('asd'); | ||
} | ||
}); | ||
const w = new Writable({ | ||
autoDestroy: true, | ||
write() {} | ||
}); | ||
|
||
r.pipe(w); | ||
w.destroy(new Error('asd')); |