-
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
lib/https: convert to using internal/errors #15603
Conversation
doc/api/errors.md
Outdated
### ERR_HTTP_NO_DOMAIN | ||
|
||
An error using the `'ERR_HTTP_NO_DOMAIN'` code is thrown specifically when an attempt | ||
is made to parse an URL without a valid domain name. |
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.
Tiny nit: "a URL".
Hi, who is responsible to merge this pr? |
@ramimoshe any collaborator can land a PR but we wait for 48+ h to make sure everyone had a chance to look at it. |
Is this code currently not covered? In that case it would be great to add a new test. |
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 already existing error type ERR_INVALID_DOMAIN_NAME
instead of adding a redundant new one.
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 even though I would strongly prefer to have a test added for this case before landing.
@ramimoshe would you be so kind and add a test for this as well? That would be really great. If you need any help, please let me know. |
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
@BridgeAR This code is indeed covered in tests. IMO, this PR should fix that test. This line: const error = 'Unable to determine the domain name'; ...should be changed to something like this: const error = common.expectsError({code: 'ERR_INVALID_DOMAIN_NAME'}); (Maybe include the |
(Also, this will need a CI run before landing, of course.) |
(Actually, I'm inclined to CI this now, land it, and then PR the test fix myself. If @ramimoshe wants to learn all about how we write our tests and stuff, awesome. But I'm going to avoid piling on changes for a first-time contribution.) |
cd0af98
to
b093e7d
Compare
Hmmm....merge conflicts even though GitHub doesn't seem to notice them. Squashed, rebased, force-pushed. Trying again. |
Landed in 4843c2f |
PR-URL: #15603 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
Welcome @ramimoshe and thanks for the contribution! 🎉 |
Thanks everyone :) |
BTW I will try to add tests in my other open PR |
@ramimoshe that's how we land PRs you can find more info on the process in our documentation. |
PR-URL: nodejs/node#15603 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
covert lib/https.js over to using lib/internal/errors.js
ref: #11273