Browse Source

stream: improve unimplemented _write() error

This commit improves the ambiguous "not implemented" error
that is provided when a writable stream does not implement
_write().

Fixes: https://github.com/nodejs/node/issues/7396
PR-URL: https://github.com/nodejs/node/pull/7671
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v7.x
ratikesh9 8 years ago
committed by cjihrig
parent
commit
9983af0347
  1. 2
      lib/_stream_writable.js

2
lib/_stream_writable.js

@ -432,7 +432,7 @@ function clearBuffer(stream, state) {
}
Writable.prototype._write = function(chunk, encoding, cb) {
cb(new Error('not implemented'));
cb(new Error('_write() method is not implemented'));
};
Writable.prototype._writev = null;

Loading…
Cancel
Save