(error: unknown)
| 30 | } |
| 31 | |
| 32 | function stringifyError(error: unknown): string { |
| 33 | if (error instanceof Error) { |
| 34 | const cause = (error as { cause?: unknown }).cause |
| 35 | return [ |
| 36 | error.name, |
| 37 | error.message, |
| 38 | cause === undefined ? `` : stringifyError(cause), |
| 39 | ] |
| 40 | .filter(Boolean) |
| 41 | .join(` `) |
| 42 | } |
| 43 | return String(error) |
| 44 | } |
| 45 | |
| 46 | export function classifyModelProviderError( |
| 47 | error: unknown |
no test coverage detected