Skip to content

Conversation

@starkwang
Copy link
Contributor

@starkwang starkwang commented Jul 13, 2017

Migrate dns errors to use internal/errors.

Ref: #11273

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

dns, errors

@nodejs-github-bot nodejs-github-bot added dns Issues and PRs related to the dns subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Jul 13, 2017
@starkwang starkwang force-pushed the dns-internal-errors branch from ebfd843 to be61d5d Compare July 13, 2017 06:08
Copy link
Member

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?

Copy link
Member

@jasnell jasnell left a 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.

@starkwang starkwang force-pushed the dns-internal-errors branch 2 times, most recently from 1ae02d3 to 56d8131 Compare July 18, 2017 07:59
Copy link
Member

@jasnell jasnell left a 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.

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jul 19, 2017
Copy link
Contributor

@XadillaX XadillaX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@XadillaX
Copy link
Contributor

@starkwang
Copy link
Contributor Author

starkwang commented Jul 22, 2017

One failure in CI looks unrelated.
https://ci.nodejs.org/job/node-test-binary-arm/RUN_SUBSET=0,label=pi1-raspbian-wheezy/9392/console

  ...
not ok 23 parallel/test-child-process-fork-exec-path
  ---
  duration_ms: 8.891
  severity: fail
  stack: |-
  ...

Copy link
Contributor

@refack refack left a 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i

Copy link
Contributor

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}]`

Copy link
Contributor

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"`
  }
);

Copy link
Contributor

@refack refack Jul 24, 2017

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.

@refack
Copy link
Contributor

refack commented Jul 24, 2017

@nodejs/ctc @fhinkel @mcollina @mhdawson

@starkwang starkwang force-pushed the dns-internal-errors branch from 56d8131 to 0653452 Compare July 24, 2017 04:31
@starkwang
Copy link
Contributor Author

Pushed commit to address comments.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@refack
Copy link
Contributor

refack commented Jul 24, 2017

@refack
Copy link
Contributor

refack commented Jul 24, 2017

Landed in 9cb390d

@refack refack closed this Jul 24, 2017
refack pushed a commit that referenced this pull request Jul 24, 2017
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dns Issues and PRs related to the dns subsystem. errors Issues and PRs related to JavaScript errors originated in Node.js core. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants