-
Notifications
You must be signed in to change notification settings - Fork 30k
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
errors socket_list : Migrate errors to internal/errors.js #11356
errors socket_list : Migrate errors to internal/errors.js #11356
Conversation
lib/internal/socket_list.js
Outdated
@@ -22,7 +24,7 @@ SocketListSend.prototype._request = function(msg, cmd, callback) { | |||
|
|||
function onclose() { | |||
self.slave.removeListener('internalMessage', onreply); | |||
callback(new Error('Slave closed before reply')); | |||
callback(new errors.Error('SLAVE_CLOSED_BEFORE_REPLY')); |
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.
Please use the naming pattern ERR_***
@jasnell requested changes are done. |
lib/internal/errors.js
Outdated
@@ -86,3 +86,4 @@ module.exports = exports = { | |||
// Note: Please try to keep these in alphabetical order | |||
E('ERR_ASSERTION', (msg) => msg); | |||
// Add new errors from here... | |||
E('ERR_SLAVE_CLOSED_BEFORE_REPLY','Slave closed before reply'); |
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.
nit: running make lint
should complain on this. There needs to be a single space after the comma before 'Slave...
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.
LGTM with a nit
lib/internal/socket_list.js
Outdated
@@ -22,7 +24,7 @@ SocketListSend.prototype._request = function(msg, cmd, callback) { | |||
|
|||
function onclose() { | |||
self.slave.removeListener('internalMessage', onreply); | |||
callback(new Error('Slave closed before reply')); | |||
callback(new errors.Error('ERR_SLAVE_CLOSED_BEFORE_REPLY')); |
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.
Are there other PR documenting this error code? Otherwise this needs a documentation.
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.
Refs: Documenting new errors
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.
not yet
@bougarfaoui Do you want to take a stab at addressing the comments? Thanks! |
I'm closing this because it's been inactive for quite a while. Feel free to reopen or ping a collaborator to get it reopened if needed. |
I'm following up |
7cc85e2
to
892ff1c
Compare
892ff1c
to
e4f04f5
Compare
e4f04f5
to
71cb153
Compare
@joyeecheung @fhinkel PTAL ( @Trott ? ) |
doc/api/errors.md
Outdated
<a id="ERR_CHILD_CLOSED_BEFORE_REPLY"></a> | ||
### ERR_CHILD_CLOSED_BEFORE_REPLY | ||
|
||
Used when a child process is closed before the parent got a replay. |
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.
Typo: replay
-> reply
Micronit: got
-> received
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.
If CI is green, LGTM once typo is corrected.
PR-URL: nodejs#11356 Refs: nodejs#11273 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in a03d8ce |
Ref: #11273
Semver-major because this updates specific error messages and converts errors over to use the new internal/errors.js mechanism.
cc @jasnell
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
errors, socket_list