{"record":{"id":"282c93822bb7c61d","repo":"DioxusLabs/dioxus","slug":"request-failed-e","errorCode":null,"errorMessage":"Request failed: {e}","messagePattern":"Request failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"packages/cli/src/serve/proxy.rs","lineNumber":72,"sourceCode":"    let io = TokioIo::new(stream);\n\n    // Perform HTTP/1.1 handshake on the same connection\n    let (mut sender, conn) = http1::handshake(io)\n        .await\n        .map_err(|e| handle_error(anyhow::anyhow!(\"HTTP handshake failed: {e}\")))?;\n\n    // Spawn connection driver to keep it alive\n    tokio::spawn(async move {\n        if let Err(e) = conn.await {\n            tracing::debug!(\"Connection closed: {e}\");\n        }\n    });\n\n    // Send request through the established connection (streaming body)\n    sender\n        .send_request(req)\n        .await\n        .map_err(|e| handle_error(anyhow::anyhow!(\"Request failed: {e}\")))\n}\n\n/// Add routes to the router handling the specified proxy config.\n///\n/// We will proxy requests directed at either:\n///\n/// - the exact path of the proxy config's backend URL, e.g. /api\n/// - the exact path with a trailing slash, e.g. /api/\n/// - any subpath of the backend URL, e.g. /api/foo/bar\npub(crate) fn add_proxy(mut router: Router, proxy: &WebProxyConfig) -> Result<Router> {\n    let url: Uri = proxy.backend.parse()?;\n    let path = url.path().to_string();\n    let trimmed_path = path.trim_start_matches('/');\n\n    if trimmed_path.is_empty() {\n        bail!(\n            \"Proxy backend URL must have a non-empty path, e.g. {}/api instead of {}\",\n            proxy.backend.trim_end_matches('/'),","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/fda3dc9c2b10ddf4417edcbb98caa9613ac92d26/packages/cli/src/serve/proxy.rs#L54-L90","documentation":"Raised in send_with_retry (called from proxy_to) when the established hyper connection's sender fails to send the proxied request to the backend. This means the handshake succeeded but the request could not be delivered — connection closed mid-request or protocol violation — and, like the handshake failure, it is converted via handle_error into an HTTP error response for the client.","triggerScenarios":"Thrown at packages/cli/src/serve/proxy.rs:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The proxied request failed. Check that the backend is reachable and read its logs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fda3dc9c2b10ddf4417edcbb98caa9613ac92d26","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}