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

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
7 participants
@ratikesh9
Contributor

ratikesh9 commented Jul 12, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected 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

ratikesh
errorMessage: Improvement in the error thrown in case of writable str…
…eam write method

Files changes include the fix for  issue
Fixes: #7396
@mscdex

This comment has been minimized.

Contributor

mscdex commented Jul 12, 2016

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.

@cjihrig

This comment has been minimized.

Contributor

cjihrig commented Jul 12, 2016

Agreed. This commit also leaves commented code behind, and adds unnecessary whitespace lines.

@ratikesh9

This comment has been minimized.

Contributor

ratikesh9 commented Jul 12, 2016

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

@mscdex

This comment has been minimized.

Contributor

mscdex commented Jul 12, 2016

@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.

@ratikesh9

This comment has been minimized.

Contributor

ratikesh9 commented Jul 12, 2016

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'));

This comment has been minimized.

@cjihrig

cjihrig Jul 12, 2016

Contributor

I think this could be as simple as _write() must be implemented or _write() is not implemented.

@@ -305,6 +306,7 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
stream._writev(chunk, state.onwrite);
else
stream._write(chunk, encoding, state.onwrite);

This comment has been minimized.

@cjihrig

cjihrig Jul 12, 2016

Contributor

Please remove this line.

@@ -197,6 +197,7 @@ function validChunk(stream, state, chunk, cb) {
}
Writable.prototype.write = function(chunk, encoding, cb) {

This comment has been minimized.

@cjihrig

cjihrig Jul 12, 2016

Contributor

Please remove this line also.

@ratikesh9

This comment has been minimized.

Contributor

ratikesh9 commented Jul 12, 2016

cool will remove this

Whitespaces removed + Message fix
* Whitespaces comprising line 200, 309 removed .
* Error Message changed under _write function .
@cjihrig

This comment has been minimized.

Contributor

cjihrig commented Jul 12, 2016

I'd put () on the end of _write, but otherwise, LGTM. Let's see what others think.

@evanlucas

This comment has been minimized.

Member

evanlucas commented Jul 12, 2016

I'm +0 on it. I do think it should be semver major though since it is changing the error message

@jasnell

This comment has been minimized.

Member

jasnell commented Jul 20, 2016

I'm fairly -1 on this as it currently stands. I tend to prefer my error messages to be a bit more descriptive and I'm not seeing the value in this particular change.
Scratch that... in my vacation fogged brain I totally read that diff backwards... sigh... lol :-)
LGTM!

@ratikesh9

This comment has been minimized.

Contributor

ratikesh9 commented Jul 21, 2016

@jasnell Dude you just though made me upset with your initial comment. 👍

@cjihrig

This comment has been minimized.

Contributor

cjihrig commented Jul 21, 2016

@cjihrig

This comment has been minimized.

Contributor

cjihrig commented Jul 21, 2016

CI had one unrelated failure. Landing this.

@cjihrig

This comment has been minimized.

Contributor

cjihrig commented Jul 21, 2016

Landed in 9983af0. Thanks!

@cjihrig cjihrig closed this Jul 21, 2016

cjihrig added a commit that referenced this pull request Jul 21, 2016

stream: improve unimplemented _write() error
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 <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@gibfahn gibfahn referenced this pull request Jun 15, 2017

Closed

Auditing for 6.11.1 #230

2 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment