mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 14:56:19 +00:00

Use the same error code and always emit the error instead of throwing it. PR-URL: https://github.com/nodejs/node/pull/18813 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaë Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
15 lines
297 B
JavaScript
15 lines
297 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const { Readable } = require('stream');
|
|
|
|
const readable = new Readable();
|
|
|
|
readable.on('error', common.expectsError({
|
|
code: 'ERR_METHOD_NOT_IMPLEMENTED',
|
|
type: Error,
|
|
message: 'The _read() method is not implemented'
|
|
}));
|
|
|
|
readable.read();
|