From: isaacs Date: Fri, 14 Dec 2012 18:49:16 +0000 (-0800) Subject: streams2: Still emit error if there was a write() cb X-Git-Tag: v0.9.4~42^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3751c0fe40ed22aaa281abda914ef9bf0c02edac;p=platform%2Fupstream%2Fnodejs.git streams2: Still emit error if there was a write() cb --- diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 7364d3a..619603f 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;