{"record":{"id":"270c48b233eeccf5","repo":"openai/codex","slug":"http-status-body","errorCode":null,"errorMessage":"http {status}: {body:?}","messagePattern":"http (.+?): (.+?)","errorType":"http","errorClass":"TransportError","httpStatus":null,"severity":"error","filePath":"codex-rs/http-client/src/error.rs","lineNumber":10,"sourceCode":"//! Errors returned by the shared Codex HTTP transport.\n\nuse crate::client::HttpError;\nuse http::HeaderMap;\nuse http::StatusCode;\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum TransportError {\n    #[error(\"http {status}: {body:?}\")]\n    Http {\n        status: StatusCode,\n        url: Option<String>,\n        headers: Option<HeaderMap>,\n        body: Option<String>,\n    },\n    #[error(\"retry limit reached\")]\n    RetryLimit,\n    #[error(\"timeout\")]\n    Timeout,\n    #[error(\"connection failed: {0}\")]\n    Connection(#[source] HttpError),\n    #[error(\"network error: {0}\")]\n    Network(String),\n    #[error(\"request build error: {0}\")]\n    Build(String),\n}\n","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/http-client/src/error.rs#L1-L28","documentation":"A non-success HTTP response was returned by the remote server. This Http variant of TransportError carries the status code plus optional url, headers, and body captured from the response; it fires whenever the transport finishes a request with a 4xx/5xx status and callers are expected to branch on `status` to decide between retry, auth refresh, or surfacing the failure.","triggerScenarios":"Thrown at codex-rs/http-client/src/error.rs:10 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Branch on the status code: retry idempotent requests on 408/429/5xx with backoff, honor Retry-After when present","For 401/403, refresh credentials or API keys before retrying","For other 4xx, inspect the captured body/headers for the API-specific error details and fix the request","Log url and headers (minus secrets) to correlate with server-side failures"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}