-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
timers, errors: migrate to internal/errors.js #11384
Conversation
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.
Almost there. Will need to look at one of the errors
} | ||
|
||
if (msecs < 0 || !isFinite(msecs)) { | ||
throw new RangeError('"msecs" argument must be ' + | ||
throw new errors.RangeError('ERR_INVALID_ARG_TYPE', 'msecs', | ||
'a non-negative finite number'); |
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.
hmm.. will have to think about this one because the error message is not going to format that well.
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.
We could have separate error statements for non-finite and negative numbers
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.
Yeah. It would be a separate error code but that's workable
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.
Yeah. It would be a separate error code but that's workable
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.
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.
Oh, I misunderstood the discussion, it was about throwing different errors for <0
and isFinite
, sorry. Anyway I still think there should be something like ERR_NEGATIVE_ARG
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.
@shubheksha do you want to take a stab at addressing @joyeecheung 's comment? Thanks!
Blocked by #11580. |
#11580 landed, unblocking. |
@shubheksha Do you want to rebase this so we can pick this up again? Sorry for dragging it out for so long. Hope you're still interested in working on this! |
Replaced function definitions with arrow functions where possible
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. |
Hey @fhinkel, I did rebase this. |
It seems like these errors were already migrated at some point. I am closing this therefore. @shubheksha I am sorry that your PR could not land and your work is much appreciated nevertheless! |
Fixes #11273
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
timers, errors, test