-
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
WIP: module,errors: port module to internal/errors #11565
Conversation
Got an answer to |
Timers are also |
@rauno56 It was mentioned in #11580 that was linked to #11384, but I added an explicit mention there, thanks. Btw,
This is not a bugfix, not a security fix, and not a performance improvement, so this technically contradicts with the /cc @nodejs/ctc |
Perfect! Thank you. I'll finish it up this week. |
42704ed
to
ddc7f36
Compare
Keeping assigning error.code = 'MODULE_NOT_FOUND' for backwards compatibility.
ddc7f36
to
d1a292f
Compare
d1a292f
to
f7556d5
Compare
I'll follow up |
@refack are you still looking into this / did you open a follow up? |
Closing this due to a long inactivity. @rauno56 I am very sorry that your PR could not land as is and your work is much appreciated nevertheless! Please also feel free to leave a comment if you would like to follow up on this by rebasing or by opening a new PR. |
Totally understandable. Sorry for dropping the ball, got busy and
discouraged by the delay and confusion in the beginning.
|
@rauno56 I am very sorry to hear that but I understand your frustration that it took long. For a while there were to many open PRs that it became significantly difficult to keep up with all the PRs. This has improved a lot now and I am certain it reviews would be much faster now. I am reopening this in the hope you would still want to pursue this further. If not, please let us know as well. |
Well, I actually just checked and it seems like it was already ported in the meanwhile. I am very sorry about this @rauno56 |
Porting
module.js
to useinternal/errors.js
according to tracking issue #11273 and sample PR #11294.Porting module can be tricky because it's errors are commonly parsed in user-land.
This code sets some properties on caught errors from JSON parsing(example: https://github.com/nodejs/node/blob/master/lib/module.js#L94-L95) should those be left unchanged(as those are really not node libs' errors) or rethrown as new internal error(as we want every error from node to become standardized)?
Additionally to me it makes sense to also leave in setting
error.code
for backwards compatibility onMODULE_NOT_FOUND
error(https://github.com/nodejs/node/blob/master/lib/module.js#L471). Case against that would again be that if we're going to break backwards compatibility, let's just clean it up really nice as we're doing that.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
errors, module