fix(mcp): prevent internal handler serialization errors from being silently discarded or defaulting to empty strings
This commit is contained in:
1 parent
8f32a09399
commit
febd48c65d
5 files changed
+12
-12
No files matched your search
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user