(error: unknown)
| 40 | } |
| 41 | |
| 42 | export function isUrlLoadError(error: unknown): error is UrlLoadError { |
| 43 | if (!isRecord(error)) { |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | return ( |
| 48 | isUrlLoadErrorType(error.type) && |
| 49 | typeof error.message === 'string' && |
| 50 | isOptionalString(error.details) && |
| 51 | isOptionalString(error.failedFile) |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | export function formatUrlLoadError(error: UrlLoadError): string { |
| 56 | return error.message + (error.details ? `: ${error.details}` : ''); |
no test coverage detected