Documentation
¶
Overview ¶
Package errors defines error types and exit codes for the Fizzy CLI. Types and constants are thin re-exports from the shared output package.
Index ¶
- Constants
- type CLIError
- func FromHTTPStatus(status int, message string) *CLIError
- func NewAuthError(message string) *CLIError
- func NewError(message string) *CLIError
- func NewForbiddenError(message string) *CLIError
- func NewInvalidArgsError(message string) *CLIError
- func NewNetworkError(message string) *CLIError
- func NewNotFoundError(message string) *CLIError
- func NewValidationError(message string) *CLIError
Constants ¶
const ( ExitSuccess = output.ExitOK // 0 ExitUsage = output.ExitUsage // 1 ExitNotFound = output.ExitNotFound // 2 ExitAuth = output.ExitAuth // 3 ExitForbidden = output.ExitForbidden // 4 ExitRateLimit = output.ExitRateLimit // 5 ExitNetwork = output.ExitNetwork // 6 ExitAPI = output.ExitAPI // 7 ExitAmbiguous = output.ExitAmbiguous // 8 // Deprecated aliases — kept for compilation, values change. ExitError = output.ExitAPI // was 1, now 7 ExitInvalidArgs = output.ExitUsage // was 2, now 1 ExitAuthFailure = output.ExitAuth // was 3, stays 3 ExitValidation = output.ExitAPI // was 6, now 7 )
Exit codes aligned to the shared rubric.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLIError ¶
CLIError is a type alias for output.Error. Breaking change: ExitCode is now a method, not a field.
func FromHTTPStatus ¶
FromHTTPStatus creates an appropriate error from an HTTP status code.
func NewAuthError ¶
NewAuthError creates an authentication error with a fizzy-specific hint.
func NewForbiddenError ¶
NewForbiddenError creates a permission denied error.
func NewInvalidArgsError ¶
NewInvalidArgsError creates a usage/invalid-arguments error.
func NewNetworkError ¶
NewNetworkError creates a network error with retryable hint.
func NewNotFoundError ¶
NewNotFoundError creates a not found error.
func NewValidationError ¶
NewValidationError creates a validation error (mapped to API error).