Files
website/src/composables/errors.ts

11 lines
318 B
TypeScript

import { FetchError } from 'ofetch';
import { getApiError as baseGetApiError } from '~~/shared/errors';
import type { ApiError } from '~~/shared/errors';
export function getApiError(error: any): ApiError {
if (error instanceof FetchError) {
return baseGetApiError(error.data);
}
return baseGetApiError(error);
}