Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The error message is confusing when the callback of transform implementation is called multiple times #12513

Closed
kt3k opened this issue Apr 19, 2017 · 0 comments
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. stream Issues and PRs related to the stream subsystem.

Comments

@kt3k
Copy link
Contributor

kt3k commented Apr 19, 2017

  • Subsystem: stream

When we call the callback of transform implementation multiple times like the below:

const { Transform } = require('stream');
const t = new Transform({ transform (chunk, enc, cb) { cb(); cb(); } });
t.write('aa');

It emits the error event with the message Error: no writecb in Transform class.
The message talks about the internal implementation writecb and doesn't make much sense to the users.

I think it's more informative to give the message like Inappropriate multiple calls of callback of transform implementation.

I saw many gulp users see and are confused by the above error message. 1 2 3 etc

@vsemozhetbyt vsemozhetbyt added errors Issues and PRs related to JavaScript errors originated in Node.js core. stream Issues and PRs related to the stream subsystem. labels Apr 19, 2017
cjihrig added a commit to cjihrig/node that referenced this issue May 22, 2017
When a transform stream's callback is called more than once,
an error is emitted with a somewhat confusing message. This
commit hopes to improve the quality of the error message.

Fixes: nodejs#12513
PR-URL: nodejs#12520
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this issue May 23, 2017
When a transform stream's callback is called more than once,
an error is emitted with a somewhat confusing message. This
commit hopes to improve the quality of the error message.

Fixes: #12513
PR-URL: #12520
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
jasnell pushed a commit that referenced this issue May 23, 2017
When a transform stream's callback is called more than once,
an error is emitted with a somewhat confusing message. This
commit hopes to improve the quality of the error message.

Fixes: #12513
PR-URL: #12520
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants