Tool Calling: stringify errors instead of silently failing
| @@ -292,10 +292,10 @@ export class ToolManager { | ||
| 292 | 292 | |
| 293 | 293 | if (error instanceof Error) { |
| 294 | 294 | error.cause = name; |
| 295 | 295 | return error.toString(); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | return new Error('Unknown error occurred while invoking the tool.', { cause: name }).toString(); |
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |