diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 7364d3ab1..619603fca 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -175,8 +175,10 @@ function onwrite(stream, er) { }); else cb(er); - } else - stream.emit('error', er); + } + + // backwards compatibility. still emit if there was a cb. + stream.emit('error', er); return; } state.length -= l;