Documentation
¶
Overview ¶
Package errors provides centralized error handling for OpenPass CLI commands. It defines typed errors with exit codes and consistent error wrapping.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIError ¶
CLIError is a structured error with an exit code and user-friendly message.
func NewCLIError ¶
NewCLIError creates a new CLIError with the given code, message, and optional cause.
type ExitCode ¶
type ExitCode int
ExitCode represents a process exit code for CLI commands.
const ( // ExitSuccess indicates successful completion. ExitSuccess ExitCode = 0 // ExitGeneralError indicates a general error. ExitGeneralError ExitCode = 1 // ExitUsageError indicates a command-line usage error. ExitUsageError ExitCode = 2 // ExitVaultLocked indicates the vault is locked or passphrase is missing. ExitVaultLocked ExitCode = 3 // ExitNotInitialized indicates the vault is not initialized. ExitNotInitialized ExitCode = 4 // ExitMCPError indicates an MCP server error. ExitMCPError ExitCode = 5 )
func ExitCodeFromError ¶
ExitCodeFromError extracts the exit code from an error. If the error is a *CLIError, it returns the embedded code. Otherwise, it returns ExitGeneralError.
Click to show internal directories.
Click to hide internal directories.