UNPKG

@zcatalyst/utils

Version:

30 lines (29 loc) 1.12 kB
export interface ICatalystError { code: string; message: string; value?: unknown; statusCode?: number; } export declare class CatalystError extends Error { errorInfo: ICatalystError; constructor(errorInfo: ICatalystError); /*@return {string} The error code. */ readonly code: string; /*@return {string} The error message. */ readonly message: string; /*@return {any} The value that caused this error. */ readonly value: unknown; /*@return {any} The error status code. */ readonly statusCode: number; /** @return {ICatalystError} The object representation of the error. */ toJSON(): ICatalystError; /** @return {string} The string representation of the error. */ toString(): string; } export declare class PrefixedCatalystError extends CatalystError { codePrefix: string; constructor(codePrefix: string, code: string, message: string, value?: unknown, statusCode?: number); } export declare class CatalystAppError extends PrefixedCatalystError { constructor(code: string, message: string, value?: unknown); }