Skip to content

fix: log DNS resolver errors and differentiate by code#90

Merged
rubenhensen merged 1 commit into
mainfrom
fix/dns-verification-logging
May 25, 2026
Merged

fix: log DNS resolver errors and differentiate by code#90
rubenhensen merged 1 commit into
mainfrom
fix/dns-verification-logging

Conversation

@dobby-coder

@dobby-coder dobby-coder Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the bare catch {} in verifyDns with a structured console.error log (orgId, domain, error code, message) so operators can grep for failed lookups.
  • Branches the user-facing error message on NodeJS.ErrnoException.code: ENOTFOUND → "Domain X not found", ENODATA → "No TXT records found for X", everything else → existing generic message.
  • Adds tests/unit/dns-verification.test.ts covering happy path, mismatched TXT, ENOTFOUND, ENODATA, generic Error, and the "no record for org" early return.

Closes #88

Test plan

  • npm run test:unit -- --run — 58 tests pass (6 new)
  • npm run check — 0 errors, 0 warnings
  • npm run lint — clean

The catch block in verifyDns silently swallowed every error from
resolve() and returned the same opaque message. Operators had no
log line to grep when a customer reported repeated DNS check
failures, and users could not distinguish a missing domain from a
domain with no TXT records.

Log the failed lookup with orgId, domain, error code, and message,
and branch the user-facing message on ENOTFOUND / ENODATA. Falls
back to the existing generic message for any other resolver error.

Closes #88
@rubenhensen rubenhensen merged commit d7023c4 into main May 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DNS verification swallows resolver errors silently — no logging, no error class differentiation

1 participant