Browse Source

errors,stream_wrap: use internal/errors.js

PR-URL: https://github.com/nodejs/node/pull/13291
Refs: https://github.com/nodejs/node/issues/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>
v6
LAKSHMI SWETHA GOPIREDDY 8 years ago
committed by Tobias Nießen
parent
commit
d2913384aa
  1. 3
      lib/_stream_wrap.js
  2. 1
      lib/internal/errors.js

3
lib/_stream_wrap.js

@ -9,6 +9,7 @@ const JSStream = process.binding('js_stream').JSStream;
var Buffer = require('buffer').Buffer; var Buffer = require('buffer').Buffer;
const uv = process.binding('uv'); const uv = process.binding('uv');
const debug = util.debuglog('stream_wrap'); const debug = util.debuglog('stream_wrap');
const errors = require('internal/errors');
function StreamWrap(stream) { function StreamWrap(stream) {
const handle = new JSStream(); const handle = new JSStream();
@ -51,7 +52,7 @@ function StreamWrap(stream) {
this.pause(); this.pause();
this.removeListener('data', ondata); this.removeListener('data', ondata);
self.emit('error', new Error('Stream has StringDecoder')); self.emit('error', new errors.Error('ERR_STREAM_HAS_STRINGDECODER'));
return; return;
} }

1
lib/internal/errors.js

@ -158,6 +158,7 @@ E('ERR_PARSE_HISTORY_DATA',
E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support'); E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support');
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed'); E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
E('ERR_STDOUT_CLOSE', 'process.stdout 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', E('ERR_TRANSFORM_ALREADY_TRANSFORMING',
'Calling transform done when still transforming'); 'Calling transform done when still transforming');
E('ERR_TRANSFORM_MULTIPLE_CALLBACK', 'Callback called multiple times'); E('ERR_TRANSFORM_MULTIPLE_CALLBACK', 'Callback called multiple times');

Loading…
Cancel
Save