zed-industries/zed · error
error performing web search. Status: {status:?} Body: {body}
Error message
error performing web search.
Status: {status:?}
Body: {body} What it means
Sentinel error raised in perform_web_search after the authenticated LLM API request returns a non-success HTTP status; it wraps the raw status code and response body so callers can see why the backend rejected the search request (auth failure, bad organization id, upstream outage, malformed request).
Source
Thrown at crates/web_search_providers/src/cloud.rs:95
.authenticated_llm_request(&llm_api_token, organization_id, |token| {
Ok(http_client::Request::builder()
.method(Method::POST)
.uri(url.as_ref())
.header("Content-Type", "application/json")
.header("Authorization", format!("Bearer {token}"))
.body(body.clone().into())?)
})
.await?;
if response.status().is_success() {
let mut body = String::new();
response.body_mut().read_to_string(&mut body).await?;
Ok(serde_json::from_str(&body)?)
} else {
let status = response.status();
let mut body = String::new();
response.body_mut().read_to_string(&mut body).await?;
anyhow::bail!("error performing web search.\nStatus: {status:?}\nBody: {body}");
}
}
View on GitHub (pinned to f4178619ac)
Solutions
- Inspect the Status field: 401/403 indicate an expired or invalid llm_api_token, re-authenticate before retrying
- 404/422 usually mean an invalid organization_id or unsupported endpoint; verify the organization id and request payload
- 5xx errors are transient server-side failures; retry with backoff
- Check the Body field for provider-specific error messages with actionable details
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/web_search_providers/src/cloud.rs:95 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/40fa833c96b7556e.
Report an issue: GitHub.