mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-03-25 09:25:47 +00:00
ultimate error capture
This commit is contained in:
parent
cc73b22c6f
commit
b2c5c9ac96
1 changed files with 10 additions and 1 deletions
11
src/index.ts
11
src/index.ts
|
|
@ -225,7 +225,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|||
} as ToolResponse;
|
||||
}
|
||||
|
||||
throw error;
|
||||
// For any other error, return a proper error response instead of throwing
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text" as const,
|
||||
text: `Tool execution failed: ${error instanceof Error ? error.message : String(error)}`,
|
||||
},
|
||||
],
|
||||
isError: true,
|
||||
} as ToolResponse;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue