Skip to content

Commit

Permalink
errors,stream_wrap: use internal/errors.js
Browse files Browse the repository at this point in the history
PR-URL: #13291
Refs: #11273
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
LakshmiSwethaG authored and tniessen committed Jun 20, 2017
1 parent 275d0b3 commit d291338
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/_stream_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const JSStream = process.binding('js_stream').JSStream;
var Buffer = require('buffer').Buffer;
const uv = process.binding('uv');
const debug = util.debuglog('stream_wrap');
const errors = require('internal/errors');

function StreamWrap(stream) {
const handle = new JSStream();
Expand Down Expand Up @@ -51,7 +52,7 @@ function StreamWrap(stream) {
this.pause();
this.removeListener('data', ondata);

self.emit('error', new Error('Stream has StringDecoder'));
self.emit('error', new errors.Error('ERR_STREAM_HAS_STRINGDECODER'));
return;
}

Expand Down
1 change: 1 addition & 0 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ E('ERR_PARSE_HISTORY_DATA',
E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support');
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
E('ERR_STREAM_HAS_STRINGDECODER', 'Stream has StringDecoder');
E('ERR_TRANSFORM_ALREADY_TRANSFORMING',
'Calling transform done when still transforming');
E('ERR_TRANSFORM_MULTIPLE_CALLBACK', 'Callback called multiple times');
Expand Down

0 comments on commit d291338

Please sign in to comment.