fix(mcp): prevent internal handler serialization errors from being silently discarded or defaulting to empty strings

This commit is contained in:
Riz Ashraf committed 2026-09-27 22:30:32 +01:00
1 parent 8f32a09399
commit febd48c65d
5 files changed
+12 -12

No files matched your search

+2 -2
View File
@@ -276,8 +276,8 @@ impl McpTool for ReadPreferencesHandler {
async fn execute(&self, _args: Value, state: Arc<MemoryState>) -> Result<String, String> {
let data = state
.prefs
.read_with(|prefs| serde_json::to_string(prefs).unwrap_or_default());
Ok(data)
.read_with(|prefs| serde_json::to_string(prefs).map_err(|e| e.to_string()));
data
}
}