Fix error swallowing by propagating JSON serialization errors to LLM

This commit is contained in:
Riz Ashraf committed 2026-09-27 09:44:04 +01:00
1 parent 48a1973ea6
commit 01d3c22c57
6 files changed
+59 -59

No files matched your search

+5 -5
View File
@@ -380,8 +380,8 @@ impl McpTool for SearchNodesHandler {
result.entities.insert(id, e);
}
}
serde_json::to_string(&result).unwrap_or_default()
});
serde_json::to_string(&result).map_err(|e| e.to_string())
})?;
Ok(data)
}
}
@@ -418,8 +418,8 @@ impl McpTool for OpenNodesHandler {
result.entities.insert(name, e);
}
}
serde_json::to_string(&result).unwrap_or_default()
});
serde_json::to_string(&result).map_err(|e| e.to_string())
})?;
Ok(data)
}
}
@@ -620,7 +620,7 @@ impl McpTool for FindOrphansHandler {
.collect::<Vec<String>>()
});
let data = serde_json::to_string(&orphans).unwrap_or_default();
Ok(data.to_string())
Ok(data)
}
}