-
-
Couldn't load subscription status.
- Fork 33.6k
dns, errors: Migrate to use internal/errors #14212
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
Conversation
ebfd843 to
be61d5d
Compare
doc/api/errors.md
Outdated
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.
Perhaps ERR_DNS_SET_SERVERS_FAILED?
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.
Very close! thank for doing this. Left a comment I'd like to see addressed.
1ae02d3 to
56d8131
Compare
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 if CI is green.
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
|
One failure in CI looks unrelated. |
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.
Some nits
lib/dns.js
Outdated
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.
new indentation rule requires aligning to the call (
#14403
lib/dns.js
Outdated
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.
i
lib/internal/errors.js
Outdated
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.
probably better (err, servers) => `c-ares failed to set servers: "${err}" [${servers}]`
test/parallel/test-c-ares.js
Outdated
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.
New feature of expectsError can be used without assert.throws:
common.expectsError(
dns.resolve('www.google.com', val),
{
code: 'ERR_INVALID_OPT_VALUE',
type: TypeError,
message: `The value "${val}" is invalid for option "rrtype"`
}
);
doc/api/errors.md
Outdated
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.
Used when `c-ares` failed to set the DNS servers.
56d8131 to
0653452
Compare
|
Pushed commit to address comments. |
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
|
@starkwang thank you. |
|
Landed in 9cb390d |
PR-URL: #14212 Refs: #11273 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Migrate dns errors to use internal/errors.
Ref: #11273
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
dns, errors