-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
errorMessage: Improvement in the error thrown in case of writable st… #7671
Conversation
…eam write method Files changes include the fix for issue Fixes: nodejs#7396
I'm confused, this doesn't improve the message, it just removes it. If that was intentional, I don't that is the ideal solution. |
Agreed. This commit also leaves commented code behind, and adds unnecessary whitespace lines. |
i was thinking to catch the error and return some logical comment but at last commented the error partas it was not making sense . What would be a possible solution for this @cjihrig |
@ratikesh9 I think the original suggestion was to improve the message string itself to be perhaps a little more descriptive, not to change the actual logic/behavior. |
Can the error message in this 741d2fe commit would be a sufficient fix ? |
@@ -432,7 +434,7 @@ function clearBuffer(stream, state) { | |||
} | |||
|
|||
Writable.prototype._write = function(chunk, encoding, cb) { | |||
cb(new Error('not implemented')); | |||
cb(new Error('Write method cannot be invoked on the Writable stream . Method not implemented')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be as simple as _write() must be implemented
or _write() is not implemented
.
cool will remove this |
* Whitespaces comprising line 200, 309 removed . * Error Message changed under _write function .
I'd put |
I'm +0 on it. I do think it should be semver major though since it is changing the error message |
|
@jasnell Dude you just though made me upset with your initial comment. 👍 |
CI had one unrelated failure. Landing this. |
Landed in 9983af0. Thanks! |
This commit improves the ambiguous "not implemented" error that is provided when a writable stream does not implement _write(). Fixes: #7396 PR-URL: #7671 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Write stream _stream_writable.js is the file that has been changed
Description of change
…ream write method
Files changes include the fix for issue
Fixes: #7396