Fix error swallowing by propagating JSON serialization errors to LLM
This commit is contained in:
1 parent
48a1973ea6
commit
01d3c22c57
6 files changed
+59
-59
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user