{"record":{"id":"ebc6899b383bdc6d","repo":"zed-industries/zed","slug":"received-error-response-from-adapter-response","errorCode":null,"errorMessage":"Received error response from adapter. Response: {:?}","messagePattern":"Received error response from adapter\\. Response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dap/src/transport.rs","lineNumber":384,"sourceCode":"\n        result\n    }\n\n    fn process_response(response: Response) -> Result<Response> {\n        if response.success {\n            Ok(response)\n        } else {\n            if let Some(error_message) = response\n                .body\n                .clone()\n                .and_then(|body| serde_json::from_value::<ErrorResponse>(body).ok())\n                .and_then(|response| response.error.map(|msg| msg.format))\n                .or_else(|| response.message.clone())\n            {\n                anyhow::bail!(error_message);\n            };\n\n            anyhow::bail!(\n                \"Received error response from adapter. Response: {:?}\",\n                response\n            );\n        }\n    }\n\n    async fn receive_server_message<Stdout>(\n        reader: &mut BufReader<Stdout>,\n        buffer: &mut String,\n        log_handlers: Option<&LogHandlers>,\n    ) -> ConnectionResult<Message>\n    where\n        Stdout: AsyncRead + Unpin + Send + 'static,\n    {\n        let mut content_length = None;\n        loop {\n            buffer.clear();\n            match reader.read_line(buffer).await {","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/dap/src/transport.rs#L366-L402","documentation":"Fallback bail inside process_response: the adapter sent success=false, but neither body (parsed as ErrorResponse).error.format nor response.message yielded usable text, so Zed dumps the entire serialized Response with {:?}. It exists to guarantee every failed request produces an error even when the adapter omits both message and structured error body.","triggerScenarios":"An adapter replies success=false with an empty/missing message and a body that does not deserialize into ErrorResponse's error.format shape - minimal or non-compliant adapters, codelldb/delve variants that return id/naming the failure differently, or bodies whose error object uses a non-string format.","commonSituations":"Third-party or custom DAP adapters with loose conformance; adapters that report errors only via show-message events rather than the response; upgrading an adapter changes its error body schema.","solutions":["Inspect the {:?} Response dump - the request seq and body carry the real cause","Check the adapter's DAP conformance; file an issue so it sets message or error.format","Reproduce the failing request against the adapter directly to see its raw response"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.request::<SetBreakpointsRequest>(args).await {\n    Ok(resp) => Ok(resp),\n    Err(err) => {\n        // message contains the full {:?} Response dump when the adapter omitted error text\n        log::warn!(\"adapter rejected request: {err:#}\");\n        Err(err)\n    }\n}","preventionTips":["When writing a custom adapter, always set message or error.format on failed responses","Parse the debug-formatted Response in the error for request_seq to correlate with the failed call"],"tags":["dap","debug-adapter","protocol","error-response","rust"],"backgroundTag":"debug-adapter-error-response","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}