@egi/smart-db
Version:
Unified Smart DB Access
42 lines (41 loc) • 1.66 kB
TypeScript
export declare const SmartErrorLocation: {
App: SmartErrorLocationValue;
Frontend: SmartErrorLocationValue;
Backend: SmartErrorLocationValue;
Database: SmartErrorLocationValue;
UpgradeManager: SmartErrorLocationValue;
};
export declare type SmartErrorLocationType = typeof SmartErrorLocation;
export declare type SmartErrorLocationKey = keyof SmartErrorLocationType;
export declare type SmartErrorLocationValue = "APP" | "FRONTEND" | "BACKEND" | "DATABASE" | "UPGRADE-MANAGER";
export declare const SmartErrorSeverity: {
readonly Fatal: SmartErrorSeverityValue;
readonly Error: SmartErrorSeverityValue;
readonly Warning: SmartErrorSeverityValue;
readonly Info: SmartErrorSeverityValue;
readonly Debug: SmartErrorSeverityValue;
readonly Local: SmartErrorSeverityValue;
};
export declare type SmartErrorSeverityType = typeof SmartErrorSeverity;
export declare type SmartErrorSeverityKey = keyof SmartErrorSeverityType;
export declare type SmartErrorSeverityValue = "F" | "E" | "W" | "I" | "D" | "L";
export interface SmartErrorData {
message: string;
name: string;
code?: number | string;
type?: SmartErrorSeverityValue;
location?: SmartErrorLocationValue;
timestamp?: Date | string | number;
info?: Record<string, any>;
}
export declare class SmartError extends Error implements SmartErrorData {
code: number | string;
type: SmartErrorSeverityValue;
location: SmartErrorLocationValue;
timestamp: Date | string | number;
info: Record<string, any>;
private smartErrorKeys;
constructor(message: any);
toObject(): SmartErrorData;
toString(): string;
}