oven-sh/bun · error · http::Error
TooManyRedirects
TooManyRedirects
Error message
TooManyRedirects
What it means
The redirect limit was exceeded while following HTTP redirects. The client follows up to a maximum number of redirects (default ~20) before aborting with this sentinel to prevent infinite redirect loops.
Solutions
- Investigate the redirect chain for loops (A redirects to B which redirects back to A)
- Increase the redirect limit configuration if the chain is legitimate
- Fix server-side redirect configuration to avoid circular redirects
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/http/error.rs:48 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/0005bc4418e5771a.
Report an issue: GitHub.
Appendix: source
Thrown at src/http/error.rs:48
#[error("Timeout")]
Timeout,
#[error("AbortedBeforeConnecting")]
AbortedBeforeConnecting,
#[error("InvalidURL")]
InvalidURL,
#[error("ERR_TLS_CERT_ALTNAME_INVALID")]
ERR_TLS_CERT_ALTNAME_INVALID,
#[error("ClientAborted")]
ClientAborted,
#[error("HTTP2Unsupported")]
HTTP2Unsupported,
#[error("ConnectionClosed")]
ConnectionClosed,
#[error("DNSResolveFailed")]
DNSResolveFailed,
#[error("ConnectionRefused")]
ConnectionRefused,
#[error("TooManyRedirects")]
TooManyRedirects,
#[error("HTTP3Unsupported")]
HTTP3Unsupported,
#[error("ResponseHeadersTooLarge")]
ResponseHeadersTooLarge,
#[error("UnrequestedUpgrade")]
UnrequestedUpgrade,
#[error("UnexpectedData")]
UnexpectedData,
#[error("InvalidHTTPResponse")]
InvalidHTTPResponse,
#[error("InvalidContentLength")]
InvalidContentLength,
#[error("UnsupportedTransferEncoding")]
UnsupportedTransferEncoding,
#[error("RequestBodyNotReusable")]
RequestBodyNotReusable,
#[error("UnsupportedRedirectProtocol")]View on GitHub (pinned to 8c5296ac45)