oven-sh/bun · error · TypeError

DNSResolutionFailed

DNSResolutionFailed

Error message

DNSResolutionFailed

What it means

Sentinel variant of the HTTP client Error enum: name resolution for the request host failed (DNS lookup error, distinct from DNSResolveFailed's lower-level path). The hostname could not be resolved to addresses, so the request never reaches the connection stage.

Solutions

  1. Verify DNS configuration and hostname validity
  2. Check if the resolver supports returning records usable for QUIC connections
  3. Test with dig/nslookup to confirm the hostname resolves
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/http/error.rs:88 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/baee20b6a209f8b7. Report an issue: GitHub.

Appendix: source

Thrown at src/http/error.rs:88

    #[error("RedirectURLInvalid")]
    RedirectURLInvalid,
    #[error("InvalidRedirectURL")]
    InvalidRedirectURL,
    #[error("UnexpectedRedirect")]
    UnexpectedRedirect,
    #[error("ShortRead")]
    ShortRead,
    #[error("WantRead")]
    WantRead,
    #[error("WantWrite")]
    WantWrite,
    #[error("HTTP3HandshakeFailed")]
    HTTP3HandshakeFailed,
    #[error("HTTP3ProtocolError")]
    HTTP3ProtocolError,
    #[error("HTTP3HeaderEncodingError")]
    HTTP3HeaderEncodingError,
    #[error("DNSResolutionFailed")]
    DNSResolutionFailed,
    #[error("HTTP3StreamReset")]
    HTTP3StreamReset,
    #[error("HTTP3ContentLengthMismatch")]
    HTTP3ContentLengthMismatch,
    #[error("FailedToOpenSocket")]
    FailedToOpenSocket,
    #[error("InvalidCRL")]
    InvalidCRL,
    #[error("UnsupportedProxyProtocol")]
    UnsupportedProxyProtocol,
    #[error(transparent)]
    Cert(#[from] CertError),
    #[error(transparent)]
    Alloc(#[from] bun_alloc::AllocError),
    #[error(transparent)]
    Hpack(#[from] crate::lshpack::HpackError),
    #[error(transparent)]

View on GitHub (pinned to 8c5296ac45)