镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Shouldn't DNS error code 'EADNAME' be 'EBADNAME'? #3050

Description

@maarten-t

See https://github.com/nodejs/node/blob/master/lib/dns.js#L333

exports.ADNAME = 'EADNAME';

This line defines the error code ADNAME as 'EADNAME'. Shouldn't it be BADNAME and 'EBADNAME' respectively?

exports.BADNAME = 'EBADNAME';

Activity

  1. ChALkeR commented on Sep 24, 2015

    @ChALkeR
    Member
  2. added
    dnsIssues and PRs related to the dns subsystem.
    on Sep 24, 2015
  3. silverwind commented on Sep 24, 2015

    @silverwind
    Contributor

    Looks like an mistake in ecfe32e. This change would be a semver-major.

  4. silverwind commented on Sep 24, 2015

    @silverwind
    Contributor

    (Unless that error code isn't returned by the API)

  5. ChALkeR commented on Sep 24, 2015

    @ChALkeR
    Member

    @silverwind Adding exports.BADNAME would be a semver-minor, removing exports.ADNAME would be a semver-major in any case (even if not returned by the API). So I would prefer that to be two separate commits, one of which could be pulled in 4.x.

  6. silverwind commented on Sep 24, 2015

    @silverwind
    Contributor

    What are these exports actually used for exactly? They don't seem to be involved in actual error handling. They certainly are undocumented, so semver rules don't strictly apply.

  7. silverwind commented on Sep 24, 2015

    @silverwind
    Contributor

    cc: @piscisaureus who added them in 858f230

  8. ChALkeR commented on Sep 24, 2015

    @ChALkeR
    Member
  9. silverwind commented on Sep 24, 2015

    @silverwind
    Contributor

    Oh, right, comparison. Well, I think a replacement here would qualify as a bugfix to match the documentation, so I think it'd be fine in a patch release actually.

  10. silverwind commented on Sep 24, 2015

    @silverwind
    Contributor

    Filed #3051.

  11. trevnorris commented on Sep 25, 2015

    @trevnorris
    Contributor

    Agreed that if the documented result doesn't match how the code works then it's a bug fix.

  12. silverwind commented on Sep 27, 2015

    @silverwind
    Contributor

    Landed in two seperate commits. exports.BADNAME will be available next version. exports.ADNAME will be removed in 5.0.0.

  13. added a commit that references this issue on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions