Closed
Description
It is tempting to do something like this:
var error = new Error('some error');
stream
.pipe(through(function(chunk) {
throw error ;
}))
.on('error', function(err) {
assert.equal(error, err);
});
For me because in promise throwing an exception equals rejection.
The docs should tell what really happens when exceptions are thrown in these kind of functions (_read
, _write
, _writev
, _transform
, _flush
).