fix: restore AppError::Internal for AST parser error, keeping BadRequest for JSON schema validation

This commit is contained in:
Riz Ashraf committed 2026-10-10 13:10:15 +01:00
1 parent 39528411f4
commit de060c4db4
10 files changed
+57 -57

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ impl McpTool for EnvironmentHandler {
}
async fn execute(&self, args: Value, state: Arc<MemoryState>) -> crate::error::Result<String> {
let req: EnvironmentTool = serde_json::from_value(args).map_err(|e| e.to_string())?;
let req: EnvironmentTool = serde_json::from_value(args).map_err(|e| crate::error::AppError::BadRequest(format!("Schema validation failed. Your JSON arguments do not match the expected tool schema: {}", e)))?;
let ns = req
.namespace
.unwrap_or_else(crate::models::default_namespace);