{"record":{"id":"fea5fb4a08d7f206","repo":"zeroclaw-labs/zeroclaw","slug":"bocha-ai-search-returned-error-code-code-msg","errorCode":null,"errorMessage":"Bocha AI search returned error (code {code}): {msg}","messagePattern":"Bocha AI search returned error \\(code (.+?)\\): (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-tools/src/web_search_tool.rs","lineNumber":744,"sourceCode":"\n        let status = response.status();\n        if !status.is_success() {\n            return Err(http_search_failure(\"bocha\", status));\n        }\n\n        let json: serde_json::Value = response.json().await?;\n        self.parse_bocha_results(&json, query)\n    }\n\n    fn parse_bocha_results(&self, json: &serde_json::Value, query: &str) -> anyhow::Result<String> {\n        if let Some(code) = json.get(\"code\").and_then(|c| c.as_i64())\n            && code != 200\n        {\n            let msg = json\n                .get(\"msg\")\n                .and_then(|m| m.as_str())\n                .unwrap_or(\"(no message)\");\n            anyhow::bail!(\"Bocha AI search returned error (code {code}): {msg}\");\n        }\n\n        let results = json\n            .get(\"data\")\n            .and_then(|d| d.get(\"webPages\"))\n            .and_then(|w| w.get(\"value\"))\n            .and_then(|v| v.as_array())\n            .ok_or_else(|| {\n                ::zeroclaw_log::record!(\n                    ERROR,\n                    ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Fail)\n                        .with_outcome(::zeroclaw_log::EventOutcome::Failure)\n                        .with_attrs(::serde_json::json!({\"search_provider\": \"bocha\"})),\n                    \"web_search: invalid Bocha AI response\"\n                );\n                anyhow::Error::msg(\"Invalid Bocha AI API response\")\n            })?;\n","sourceCodeStart":726,"sourceCodeEnd":762,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-tools/src/web_search_tool.rs#L726-L762","documentation":"Error \"Bocha AI search returned error (code {code}): {msg}\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-tools/src/web_search_tool.rs:744 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Bocha AI error code and message: invalid key, quota exhaustion, or bad request parameters are the common causes.","Verify the API key and account quota, then retry; switch providers if the error persists."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}