| 2 | * Shape of the error object thrown by ofetch/$fetch for failed API requests. |
| 3 | */ |
| 4 | export interface ApiError { |
| 5 | status?: number |
| 6 | data?: { |
| 7 | message?: string |
| 8 | data?: Record<string, string[]> |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | export function toApiError(error: unknown): ApiError { |
| 13 | if (error !== null && typeof error === 'object') { |
nothing calls this directly
no outgoing calls
no test coverage detected