/** * Custom error classes for MCP server * Provides specific error types with structured error codes and suggestions */ /** * Structured error format for consistent error reporting */ export interface StructuredError { code: string; message: string; suggestion: string; timestamp: string; context?: Record; } /** * Result type pattern for explicit error handling */ export type Result = { ok: true; value: T; } | { ok: false; error: E; }; /** * Base class for all application errors with structured error support */ export declare abstract class BaseError extends Error { abstract readonly code: string; abstract readonly suggestion: string; readonly timestamp: string; readonly context: Record | undefined; constructor(message: string, context?: Record); toStructuredError(): StructuredError; } /** * Error for input validation failures */ export declare class InputValidationError extends BaseError { readonly suggestion: string; readonly code = "INPUT_VALIDATION_ERROR"; constructor(message: string, suggestion: string); } /** * Error for file operation failures with intelligent suggestion system */ export declare class FileOperationError extends BaseError { readonly code = "FILE_OPERATION_ERROR"; get suggestion(): string; } /** * Error for Gemini API failures with intelligent suggestion system */ export declare class GeminiAPIError extends BaseError { readonly code = "GEMINI_API_ERROR"; private customSuggestion?; constructor(message: string, suggestionOrContext?: string | Record, statusCodeOrContext?: number | Record); get suggestion(): string; } /** * Error for network-related failures with intelligent suggestion system */ export declare class NetworkError extends BaseError { readonly code = "NETWORK_ERROR"; private customSuggestion?; constructor(message: string, suggestionOrContext?: string | Record, causeOrContext?: Error | Record); get suggestion(): string; } /** * Error for configuration failures */ export declare class ConfigError extends BaseError { readonly suggestion: string; readonly code = "CONFIG_ERROR"; constructor(message: string, suggestion: string); } /** * Error for security violations and attacks with intelligent suggestion system */ export declare class SecurityError extends BaseError { readonly code = "SECURITY_ERROR"; get suggestion(): string; } //# sourceMappingURL=errors.d.ts.map