oven-sh/bun · error · TypeError
ECONNRESET
ECONNRESET
Error message
ConnectionClosed
What it means
The underlying TCP/TLS connection was closed by the remote peer (or transport failure) before the request/response exchange completed. This is a sentinel for unexpected EOF or socket closure mid-request.
Solutions
- Retry the request with a new connection (connections may be closed by load balancers or idle timeouts)
- Check server health and stability
- Adjust keep-alive settings to avoid stale connections being reused
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/http/error.rs:42 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Connection failures: ECONNREFUSED, ECONNRESET, and friends — why connections get refused, reset, or dropped.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/0726be431920506e.
Report an issue: GitHub.
Appendix: source
Thrown at src/http/error.rs:42
#[error("HTTP2StreamReset")]
HTTP2StreamReset,
#[error("HTTP2GoAway")]
HTTP2GoAway,
#[error("HTTP2CompressionError")]
HTTP2CompressionError,
#[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")]View on GitHub (pinned to 8c5296ac45)