-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
Was looking through the stream destroy tests and noticed this. Is this something we want? I would expect that the error would not get swallowed? i.e. I would expect the original/first error to always propagate.
const write = new Writable({
write(chunk, enc, cb) { cb(); },
destroy: common.mustCall(function(err, cb) {
assert.strictEqual(err, expected);
cb();
})
});
const expected = new Error('kaboom');
write.on('finish', common.mustNotCall('no finish event'));
write.on('close', common.mustCall());
// Error is swallowed by the custom _destroy
write.on('error', common.mustNotCall('no error event'));
write.destroy(expected);
assert.strictEqual(write.destroyed, true);Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.