mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 19:24:22 +01:00
add catch for mcp tool execution
This commit is contained in:
@@ -582,7 +582,17 @@ export namespace SessionPrompt {
|
||||
args,
|
||||
},
|
||||
)
|
||||
const result = await execute(args, opts)
|
||||
const result = await execute(args, opts).catch((err) => {
|
||||
log.error("Error executing tool", { error: err, tool: key })
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: `Failed to execute tool: ${err instanceof Error ? err.message : String(err)}`,
|
||||
},
|
||||
],
|
||||
}
|
||||
})
|
||||
|
||||
await Plugin.trigger(
|
||||
"tool.execute.after",
|
||||
|
||||
Reference in New Issue
Block a user