mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-06 01:14:52 +01:00
add catch for mcp tool execution
This commit is contained in:
@@ -582,7 +582,17 @@ export namespace SessionPrompt {
|
|||||||
args,
|
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(
|
await Plugin.trigger(
|
||||||
"tool.execute.after",
|
"tool.execute.after",
|
||||||
|
|||||||
Reference in New Issue
Block a user