-
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
Tracking issue: Migrate errors to internal/errors.js #17709
Comments
Just like #11273 this should be a good first issue. People who want to start working on this can post a reply here, and cc @jasnell and me in the PR. There is a guide on how to migrate the errors, also please read the contributing guide on how to format the commit and the PR process. It's ok if you want to take multiple tasks in the OP but I would prefer one file per person so more people get the opportunity to start contributing to core. The tests would almost definitely fail after the errors in |
@joyeecheung @jasnell i can take these up. |
@joyeecheung @jasnell I can take one of these files as well |
@joyeecheung @jasnell I'd like to tackle |
@ramsgoli @mannanali413 Hi, please indicate which file you are going to work on in this thread to avoid stepping over each other's toes, thanks! |
@joyeecheung @jasnell I would like to take the |
@joyeecheung @jasnell If anyone doesn't take the |
@jasnell I will take up lib/_tls_wrap.js |
@joyeecheung @jasnell I will take lib/fs.js |
@styfle ... Heads up, I'm currently doing quite a bit of work in fs.js, including hitting the rest of the error codes |
@jasnell Should I take a different file or are you doing them all?? |
I'd like to have a go at _tls_legacy.js! This would be my first contribution to an open source project if I can figure it out. :) |
…f noticed something wrong.
After reading the Using the internal/errors.js Module I think I got the idea. I checked to see within that internal/errors document if any tests are necessary. I didn't change the error message to be anything other than a string, so I think that should not need any tests. I'm not sure if I owe any kind of test tests outside of this. Let me know if some test is needed for this, and I'll take a stab at writing it too, though I might need some guidance on it. |
@Xavier-J-Ortiz Usually the migrated error should have a test (using Can you read the contributing guide and open a PR with your changes? Thanks! |
@joyeecheung Thank you for pointing that out.
Thanks again for the guidance so far joyeecheung ! |
@joyeecheung I'm not certain if we should migrate |
@apapirovski That sounds reasonable to me. In that case, maybe we should add a comment there about why this is throwing old-style errors (I am planning to write a lint rule for that). @Xavier-J-Ortiz sorry for the fuss, can you change your PR to do that instead? Thanks. |
@joyeecheung Not a problem or a fuss. :) This is the PR I created just now for this. #17759 Let me know if this is what you were thinking in terms of the comment. |
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. Refs:nodejs#17709 (comment)
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Remove the extra space in the message corresponding to the key ERR_TLS_RENEGOTIATION_DISABLED . Fixes: nodejs#17709
This migrates the old style error in _tls_wrap.js to the new style error ERR_TLS_RENEGOTIATION_DISABLED. Refs: #17709 PR-URL: #17792 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Throw ERR_INVALID_ARG_TYPE when validating arguments passed to WriteStream.prototype._write. Refs: #17709 PR-URL: #17719 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>
Throw ERR_SOCKET_CLOSED and ERR_SERVER_NOT_RUNNING instead of the old-style errors in net.js. PR-URL: #17766 Refs: #17709 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
A couple of lib/_http_outgoing.js's errors were still in the "old style": `throw new Error(<some message here>)`. This commit migrates those 2 old style errors to the "new style": internal/errors.js's error-system. In the future, changes to these errors' messages won't break semver-major status. With the old style, changes to these errors' messages broke semver-major status. It was inconvenient. Refs: #17709 PR-URL: #17837 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
All the errors in the OP have been migrated, thanks everyone! |
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
Old style errors are being migrated to internal/errors.js, however, due to depreciation of _tls_legacy.js, it isn't worth the effort to migrate and potentially force users to update their code for this error change. This comment clarifies the reason why this error is not migrated. PR-URL: #17759 Refs: #17709 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]>
There are a few old-style errors added since #11273 opened. Opening a new issue to track the migration. I have excluded errors that have existing
code
property as changing those could result in bigger breakages.On how to migrate those errors, see the guide: Using the internal/errors.js Module
new Error('write after end')
: can be migrated toERR_STREAM_WRITE_AFTER_END
new Error('Cannot pipe, not readable'))
: can be migrated toERR_STREAM_CANNOT_PIPE
should not be migrated because it's being deprecated. Add a comment there instead.new Error('TLS session renegotiation attack detected')
: can be migrated toERR_TLS_SESSION_ATTACK
new Error('TLS session renegotiation disabled for this socket')
: needs a new error, maybeERR_TLS_RENEGOTIATION_DISABLED
new Error('Invalid data'))
: can be migrated toERR_INVALID_ARG_TYPE
new Error('This socket is closed'), cb)
: can be migrated toERR_SOCKET_CLOSED
new Error('Not running'))
: needs a new error, maybeERR_SERVER_NOT_RUNNING
new Error('Script execution interrupted.'))
: needs a new error, maybeERR_SCRIPT_EXECUTION_INTERRUPTED
The text was updated successfully, but these errors were encountered: