mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-09-22 15:57:08 -05:00
11 lines
318 B
TypeScript
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);
|
|
}
|