UNPKG

@pod-protocol/cli

Version:

Command-line interface for PoD Protocol (Prompt or Die) AI Agent Communication Protocol

50 lines 1.46 kB
import { Ora } from "ora"; /** * Error codes for different types of CLI errors */ export declare enum ErrorCode { VALIDATION_ERROR = 1, NETWORK_ERROR = 2, WALLET_ERROR = 3, SDK_ERROR = 4, FILE_ERROR = 5, CONFIG_ERROR = 6, UNKNOWN_ERROR = 99 } /** * Standard CLI error class with error codes */ export declare class CliError extends Error { code: ErrorCode; cause?: Error; constructor(message: string, code?: ErrorCode, cause?: Error); } /** * Error handler for CLI operations */ export declare class ErrorHandler { /** * Handle errors with spinner and user-friendly messages */ static handleError(error: Error, spinner?: Ora, context?: string): never; /** * Get user-friendly error message */ private static getErrorMessage; /** * Get helpful suggestions based on error type */ private static getErrorSuggestions; /** * Create specific error types */ static validationError(message: string): CliError; static networkError(message: string, cause?: Error): CliError; static walletError(message: string, cause?: Error): CliError; static configError(message: string, cause?: Error): CliError; } /** * Utility for safely executing async operations with error handling */ export declare function safeExecute<T>(operation: () => Promise<T>, errorContext?: string, spinner?: Ora): Promise<T>; //# sourceMappingURL=error-handler.d.ts.map