@zcatalyst/utils
Version:
30 lines (29 loc) • 1.09 kB
TypeScript
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. */
get code(): string;
/** @return {string} The error message. */
get message(): string;
/** @return {any} The value that caused this error. */
get value(): unknown;
/** @return {any} The error status code. */
get 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);
}