{"record":{"id":"43104b2fdda19d72","repo":"tinyhumansai/openhuman","slug":"language-must-be-a-non-empty-string","errorCode":null,"errorMessage":"language must be a non-empty string","messagePattern":"language must be a non-empty string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/searxng.rs","lineNumber":414,"sourceCode":"        Some(value) => value\n            .as_array()\n            .ok_or_else(|| anyhow::anyhow!(\"categories must be an array of strings\"))?\n            .iter()\n            .map(|item| {\n                item.as_str()\n                    .map(str::to_string)\n                    .ok_or_else(|| anyhow::anyhow!(\"categories must contain only strings\"))\n            })\n            .collect::<anyhow::Result<Vec<_>>>()?,\n        None => Vec::new(),\n    };\n    let language = match object.get(\"language\") {\n        Some(value) => {\n            let language = value\n                .as_str()\n                .map(str::trim)\n                .filter(|value| !value.is_empty())\n                .ok_or_else(|| anyhow::anyhow!(\"language must be a non-empty string\"))?;\n            Some(language.to_string())\n        }\n        None => None,\n    };\n    let max_results = match object.get(\"max_results\") {\n        Some(value) => {\n            let max_results = value\n                .as_u64()\n                .ok_or_else(|| anyhow::anyhow!(\"max_results must be a positive integer\"))?;\n            Some(max_results.clamp(1, MAX_RESULTS as u64) as usize)\n        }\n        None => None,\n    };\n\n    Ok(SearxngSearchArgs {\n        query,\n        categories,\n        language,","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/searxng.rs#L396-L432","documentation":"Optional-field type guard in parse_search_args: \"language\" was provided but is not a string, or is empty/whitespace after trimming. The parser expects a language code such as \"en\" or \"en-US\"; any other shape fails here. The faulting input is a non-string or empty language value.","triggerScenarios":"Thrown at src/openhuman/search/tools/searxng.rs:414 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass language as a non-empty BCP-47-style code string, e.g. \"en\" or \"de\".","Omit the field entirely to use the SearXNG instance's default language.","Validate/normalize the language value before invoking the tool."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}