(error: unknown)
| 501 | * Get error type name for classification |
| 502 | */ |
| 503 | export function getErrorType(error: unknown): string { |
| 504 | if (isComponentError(error)) { |
| 505 | return error.type; |
| 506 | } |
| 507 | if (error instanceof Error) { |
| 508 | return error.name; |
| 509 | } |
| 510 | return 'UnknownError'; |
| 511 | } |
| 512 | |
| 513 | /** |
| 514 | * Wrap an unknown error in the appropriate ComponentError type. |
no test coverage detected