(error: unknown)
| 42 | * classification must look at the root cause. |
| 43 | */ |
| 44 | export function rootErrorMessage(error: unknown): string { |
| 45 | let current: unknown = error |
| 46 | while (current instanceof Error && current.cause instanceof Error) { |
| 47 | current = current.cause |
| 48 | } |
| 49 | return toError(current).message |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Known user-facing row-write failures (service validation + the best-effort |
no test coverage detected