/** * APIClaw MCP Auto-Setup - Error Handling * * Comprehensive error formatting with actionable help. * Every error includes context, suggestions, and help links. */ /** * Error codes for APIClaw setup */ export declare enum ErrorCode { CONFIG_NOT_FOUND = "CONFIG_NOT_FOUND", PERMISSION_DENIED = "PERMISSION_DENIED", INVALID_JSON = "INVALID_JSON", WRITE_FAILED = "WRITE_FAILED", BACKUP_FAILED = "BACKUP_FAILED", ALREADY_CONFIGURED = "ALREADY_CONFIGURED", INVALID_CONFIG = "INVALID_CONFIG", MERGE_CONFLICT = "MERGE_CONFLICT", CLIENT_NOT_FOUND = "CLIENT_NOT_FOUND", UNSUPPORTED_CLIENT = "UNSUPPORTED_CLIENT", NETWORK_ERROR = "NETWORK_ERROR", AUTH_FAILED = "AUTH_FAILED", UNSUPPORTED_OS = "UNSUPPORTED_OS", NODE_VERSION = "NODE_VERSION", UNKNOWN = "UNKNOWN" } /** * APIClaw error with rich context */ export declare class ApiclawError extends Error { readonly code: ErrorCode; readonly context?: Record | undefined; constructor(code: ErrorCode, message: string, context?: Record | undefined); } /** * Format an error for terminal output */ export declare function formatError(error: Error | ApiclawError): string; /** * Print an error to stderr */ export declare function printError(error: Error | ApiclawError): void; /** * Create a typed error */ export declare function createError(code: ErrorCode, message?: string, context?: Record): ApiclawError; /** * Wrap a function with error handling */ export declare function withErrorHandling(fn: () => Promise, options?: { exitOnError?: boolean; }): Promise; /** * Format a warning message */ export declare function formatWarning(message: string, suggestions?: string[]): string; /** * Print a warning to stderr */ export declare function printWarning(message: string, suggestions?: string[]): void; /** * Format an info message */ export declare function formatInfo(message: string): string; /** * Format a success message */ export declare function formatSuccess(message: string): string; //# sourceMappingURL=errors.d.ts.map