(payload: unknown)
| 278 | if (isTempadMcpErrorCode(causeCode)) return causeCode |
| 279 | return undefined |
| 280 | } |
| 281 | |
| 282 | function isTempadMcpErrorCode(value: unknown): value is TempadMcpErrorCode { |
| 283 | return typeof value === 'string' && KNOWN_ERROR_CODES.has(value) |
| 284 | } |
| 285 | |
| 286 | function extractToolErrorMessage(error: unknown): string { |
| 287 | if (error instanceof Error) return error.message || 'Unknown error occurred.' |
| 288 | if (typeof error === 'string') return error |
| 289 | const message = getRecordProperty(error, 'message') |
| 290 | if (typeof message === 'string' && message.trim()) return message |
| 291 | return 'Unknown error occurred.' |
no outgoing calls
no test coverage detected