UNPKG

@versatiledatakit/shared

Version:

Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.

23 lines (22 loc) 1.06 kB
import { ServiceHttpErrorCodes } from '../ui-error/model/interfaces'; /** * ** Generates Error code (token). * * - Code (token) starts with * - Class name, * - then followed by underscore and class PUBLIC_NAME, * - then followed by underscore and method name or underscore with some error specifics, * - then followed by underscore and additional details to avoid overlaps with other Class errors. * <b>(for http requests it should be HTTP Status Code)</b> * * <br/> * <i>returned value pattern</i>: * <p> * <Class Name><b>_</b><Class PUBLIC_NAME><b>_</b><Class method name><b>_</b><additional details, like HTTP Status Code> * </p> */ export declare const generateErrorCode: (className: string, classPublicName: string, methodName: string, additionalDetails: string) => string; /** * ** Generates supported error codes for provided className, publicName and methodName. */ export declare const generateSupportedHttpErrorCodes: (className: string, publicName: string, method: string) => ServiceHttpErrorCodes;