{"record":{"id":"4ffe5db2bba70539","repo":"zed-industries/zed","slug":"unexpected-content-type","errorCode":null,"errorMessage":"Unexpected content type: {:?}","messagePattern":"Unexpected content type: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/context_server/src/transport/http.rs","lineNumber":248,"sourceCode":"\n                        // Only send non-empty responses\n                        if !body.is_empty() {\n                            self.response_tx\n                                .send(body)\n                                .await\n                                .map_err(|_| anyhow!(\"Failed to send JSON response\"))?;\n                        }\n                    }\n                    Some(ct) if ct.starts_with(EVENT_STREAM_MIME_TYPE) => {\n                        // SSE stream - set up streaming\n                        self.setup_sse_stream(response).await?;\n                    }\n                    _ => {\n                        // For notifications, 202 Accepted with no content type is ok\n                        if is_notification && status.as_u16() == 202 {\n                            log::debug!(\"Notification accepted\");\n                        } else {\n                            return Err(anyhow!(\"Unexpected content type: {:?}\", content_type));\n                        }\n                    }\n                }\n            }\n            status if status.as_u16() == 202 => {\n                // Accepted - notification acknowledged, no response needed\n                log::debug!(\"Notification accepted\");\n            }\n            _ => {\n                let mut error_body = String::new();\n                futures::AsyncReadExt::read_to_string(response.body_mut(), &mut error_body).await?;\n\n                self.error_tx\n                    .send(format!(\"HTTP {}: {}\", response.status(), error_body))\n                    .await\n                    .map_err(|_| anyhow!(\"Failed to send error\"))?;\n            }\n        }","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/context_server/src/transport/http.rs#L230-L266","documentation":"Error \"Unexpected content type: {:?}\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/context_server/src/transport/http.rs:248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}