aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
33 lines • 1.35 kB
TypeScript
export interface ErrorContext {
service?: string;
operation?: string;
userId?: string;
metadata?: Record<string, any>;
}
export declare class ErrorHandler {
private initialized;
constructor();
private initializeSentry;
handleError(error: unknown, context?: ErrorContext): void;
handleWithFallback<T>(error: unknown, fallbackFn: () => T, context?: ErrorContext): T;
handleAsyncWithFallback<T>(error: unknown, fallbackFn: () => Promise<T>, context?: ErrorContext): Promise<T>;
wrapAsync<T extends (...args: any[]) => Promise<any>>(fn: T, context?: ErrorContext): T;
private extractErrorInfo;
createServiceError(message: string, code: string, statusCode?: number, details?: any): ServiceError;
}
export declare class ServiceError extends Error {
code: string;
statusCode: number;
details?: any | undefined;
constructor(message: string, code: string, statusCode?: number, details?: any | undefined);
}
export declare class RateLimitError extends ServiceError {
constructor(message?: string, retryAfter?: number);
}
export declare class QuotaExceededError extends ServiceError {
constructor(service: string);
}
export declare class ValidationError extends ServiceError {
constructor(message: string, fields?: Record<string, string>);
}
//# sourceMappingURL=error-handler.d.ts.map