@versatiledatakit/shared
Version:
Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.
18 lines (17 loc) • 938 B
TypeScript
import { ApiErrorMessage, ErrorRecord, ServiceHttpErrorCodes } from '../../../common';
/**
* ** Process service HTTP request error and return ErrorRecord.
*
* @param {string} objectUUID - is objectUUID of the Object for which processing error is invoked
* @param {Record<keyof ServiceHttpErrorCodes, string>} serviceHttpErrorCodes - is map of Service method supported error codes auto-handling
* @param {unknown} error - is actual error object reference
*/
export declare const processServiceRequestError: (objectUUID: string, serviceHttpErrorCodes: Record<keyof ServiceHttpErrorCodes, string>, error: unknown) => ErrorRecord;
/**
* ** Get API formatted error message from provided Error.
*/
export declare const getApiFormattedErrorMessage: (error: Error) => ApiErrorMessage;
/**
* ** Get Human readable text from HTTP error status code.
*/
export declare const getHumanReadableStatusText: (httpErrorStatus: number) => string;