@widergy/web-utils
Version:
Utility GO! Web utils
16 lines (15 loc) • 1.01 kB
TypeScript
import { Response, APIError, ResponseError } from './constants/commonInterfaces';
export declare const getResponseError: (response: Response) => any;
export declare const responseErrorTransform: (response: Response) => void;
export declare const getErrorMessage: (responseError: ResponseError, defaultError: string) => string;
export declare const existsErrorCode: (code: string, responseError: ResponseError) => boolean;
export declare const existsErrorCodes: (codes: Array<string>, responseData: ResponseError) => boolean;
interface ErrorHandlingUtils {
responseErrorTransform: (response: Response) => void;
getResponseError: (response: Response) => APIError;
getErrorMessage: (responseError: ResponseError, defaultError: string) => string;
existsErrorCode: (code: string, responseError: ResponseError) => boolean;
existsErrorCodes: (codes: Array<string>, responseData: ResponseError) => boolean;
}
declare const ERROR_HANDLING_UTILS: ErrorHandlingUtils;
export default ERROR_HANDLING_UTILS;