We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm seeing different behaviour in Node 8 and 9 vs 10, 11 and 12.
The Node 8 docs suggest an error is emitted when calling Readable.prototype.destroy, however pump doesn't propagate the error to the callback. e.g.
Readable.prototype.destroy
pump
callback
const { Readable, Writable } = require('stream'); const pump = require('pump'); console.log(process.version); const readable = new Readable({ read() { process.nextTick(() => this.destroy(new Error('This *async* error *is not* caught by `pump` in Node < 10'))) // this.destroy(new Error('This *sync* error *is* caught by `pump` in Node < 10')) }, }); const writable = new Writable({ write(chunk, encoding, done) { console.log(chunk); done(); } }) pump(readable, writable, (ex) => { console.log('Finished'); console.error(ex); // undefined in Node < 10 });
Surprisingly it can be caught by binding directly to the readable error event. e.g.
readable
readable.on('error', (ex) => { console.log('Error handler', ex); // Error });
Which is why I think it might be an issue with pump, rather than Node core?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm seeing different behaviour in Node 8 and 9 vs 10, 11 and 12.
The Node 8 docs suggest an error is emitted when calling
Readable.prototype.destroy
, howeverpump
doesn't propagate the error to thecallback
. e.g.Surprisingly it can be caught by binding directly to the
readable
error event. e.g.Which is why I think it might be an issue with
pump
, rather than Node core?The text was updated successfully, but these errors were encountered: