Download apps/server/dist/lib/error-handler.d.ts from Leon4gr45/automaker: direct link, hf CLI and curl.
- Browser
- Download file 3.75 kB
-
https://huggingface.co/spaces/Leon4gr45/automaker/resolve/main/apps/server/dist/lib/error-handler.d.ts
- Command line
-
hf download hf://spaces/Leon4gr45/automaker/apps/server/dist/lib/error-handler.d.ts
-
curl -L -o error-handler.d.ts https://huggingface.co/spaces/Leon4gr45/automaker/resolve/main/apps/server/dist/lib/error-handler.d.ts
3.75 kB
| /** | |
| * Unified Error Handling System for CLI Providers | |
| * | |
| * Provides consistent error classification, user-friendly messages, and debugging support | |
| * across all AI providers (Claude, Codex, Cursor) | |
| */ | |
| export declare enum ErrorType { | |
| AUTHENTICATION = "authentication", | |
| BILLING = "billing", | |
| RATE_LIMIT = "rate_limit", | |
| NETWORK = "network", | |
| TIMEOUT = "timeout", | |
| VALIDATION = "validation", | |
| PERMISSION = "permission", | |
| CLI_NOT_FOUND = "cli_not_found", | |
| CLI_NOT_INSTALLED = "cli_not_installed", | |
| MODEL_NOT_SUPPORTED = "model_not_supported", | |
| INVALID_REQUEST = "invalid_request", | |
| SERVER_ERROR = "server_error", | |
| UNKNOWN = "unknown" | |
| } | |
| export declare enum ErrorSeverity { | |
| LOW = "low", | |
| MEDIUM = "medium", | |
| HIGH = "high", | |
| CRITICAL = "critical" | |
| } | |
| export interface ErrorClassification { | |
| type: ErrorType; | |
| severity: ErrorSeverity; | |
| userMessage: string; | |
| technicalMessage: string; | |
| suggestedAction?: string; | |
| retryable: boolean; | |
| provider?: string; | |
| context?: Record<string, unknown>; | |
| } | |
| export interface ErrorPattern { | |
| type: ErrorType; | |
| severity: ErrorSeverity; | |
| patterns: RegExp[]; | |
| userMessage: string; | |
| suggestedAction?: string; | |
| retryable: boolean; | |
| } | |
| /** | |
| * Classify an error into a specific type with user-friendly message | |
| */ | |
| export declare function classifyError(error: unknown, provider?: string, context?: Record<string, unknown>): ErrorClassification; | |
| /** | |
| * Get a user-friendly error message | |
| */ | |
| export declare function getUserFriendlyErrorMessage(error: unknown, provider?: string): string; | |
| /** | |
| * Check if an error is retryable | |
| */ | |
| export declare function isRetryableError(error: unknown): boolean; | |
| /** | |
| * Check if an error is authentication-related | |
| */ | |
| export declare function isAuthenticationError(error: unknown): boolean; | |
| /** | |
| * Check if an error is billing-related | |
| */ | |
| export declare function isBillingError(error: unknown): boolean; | |
| /** | |
| * Check if an error is rate limit related | |
| */ | |
| export declare function isRateLimitError(error: unknown): boolean; | |
| /** | |
| * Create a standardized error response | |
| */ | |
| export declare function createErrorResponse(error: unknown, provider?: string, context?: Record<string, unknown>): { | |
| success: false; | |
| error: string; | |
| errorType: ErrorType; | |
| severity: ErrorSeverity; | |
| retryable: boolean; | |
| suggestedAction?: string; | |
| }; | |
| /** | |
| * Log error with full context | |
| */ | |
| export declare function logError(error: unknown, provider?: string, operation?: string, additionalContext?: Record<string, unknown>): void; | |
| /** | |
| * Provider-specific error handlers | |
| */ | |
| export declare const ProviderErrorHandler: { | |
| claude: { | |
| classify: (error: unknown) => ErrorClassification; | |
| getUserMessage: (error: unknown) => string; | |
| isAuth: (error: unknown) => boolean; | |
| isBilling: (error: unknown) => boolean; | |
| isRateLimit: (error: unknown) => boolean; | |
| }; | |
| codex: { | |
| classify: (error: unknown) => ErrorClassification; | |
| getUserMessage: (error: unknown) => string; | |
| isAuth: (error: unknown) => boolean; | |
| isBilling: (error: unknown) => boolean; | |
| isRateLimit: (error: unknown) => boolean; | |
| }; | |
| cursor: { | |
| classify: (error: unknown) => ErrorClassification; | |
| getUserMessage: (error: unknown) => string; | |
| isAuth: (error: unknown) => boolean; | |
| isBilling: (error: unknown) => boolean; | |
| isRateLimit: (error: unknown) => boolean; | |
| }; | |
| }; | |
| /** | |
| * Create a retry handler for retryable errors | |
| */ | |
| export declare function createRetryHandler(maxRetries?: number, baseDelay?: number): <T>(operation: () => Promise<T>, shouldRetry?: (error: unknown) => boolean) => Promise<T>; | |
| //# sourceMappingURL=error-handler.d.ts.map |