@openshift-assisted/ui-lib
Version:
React component library for the Assisted Installer UI
18 lines • 1.14 kB
TypeScript
import { AxiosError } from 'axios';
import type { Error as APIError, InfraError } from '@openshift-assisted/types/assisted-installer-service';
export declare const FETCH_ABORTED_ERROR_CODE = "ERR_CANCELED";
export declare const FETCH_CONNECTIVITY_ERROR_CODE = "CONNECTIVITY_ERROR";
export declare const SERVER_ERROR_CODE = "SERVER_ERROR";
export declare const PAGE_RELOAD_ERROR = "ECONNABORTED";
type OnError = (arg0: unknown) => void;
export declare const handleApiError: (error: unknown, onError?: OnError) => void;
export declare const getApiErrorMessage: (error: unknown) => string;
export declare const isUnknownServerError: (error: Error) => boolean;
export declare const getApiErrorCode: (error: Error | AxiosError) => string | number;
export type APIErrorMixin = InfraError & APIError;
export type AIAxiosErrorType = AxiosError<APIErrorMixin, APIErrorMixin>;
export declare const isApiError: (error: unknown) => error is AIAxiosErrorType;
export declare const captureException: (error: any, message?: string) => void;
export declare const removeProtocolFromURL: (url?: string) => string;
export {};
//# sourceMappingURL=utils.d.ts.map