-
-
Couldn't load subscription status.
- Fork 33.6k
Closed
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
- Version: Node.js v14.3.0
- Platform: Linux annoMachine 4.18.0-16-generic test: make realpath tests case-insensitive on win32 #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: console, stream
What steps will reproduce the bug?
- Create a
repro.jswhich contents is below:
ws = require('fs').createWriteStream('./foo.log');
ws.destroy();
c = new require('console').Console({
stdout: ws,
stderr: ws,
ignoreErrors: false
});
c.log("should fail");- Run
ndoe repro.js
How often does it reproduce? Is there a required condition?
Every time it reproduces on the above environment with the above procedure.
What is the expected behavior?
Invoking c.log should throw error, since the underlying streams are already destroyed, like below:
events.js:287
throw er; // Unhandled 'error' event
^
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
Note) The expected errors are thrown on Node.js v12.16.3 and v10.20.1.
What do you see instead?
No errors thrown, and script runs succesfully.
It seems that Console class ignores ignorErrors option.
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.