errors

package
v0.0.0-...-ef81f09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 2 Imported by: 0

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

View Source
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

type CLIError = output.Error

CLIError is a type alias for output.Error. Breaking change: ExitCode is now a method, not a field.

func FromHTTPStatus

func FromHTTPStatus(status int, message string) *CLIError

FromHTTPStatus creates an appropriate error from an HTTP status code.

func NewAuthError

func NewAuthError(message string) *CLIError

NewAuthError creates an authentication error with a fizzy-specific hint.

func NewError

func NewError(message string) *CLIError

NewError creates a general API error.

func NewForbiddenError

func NewForbiddenError(message string) *CLIError

NewForbiddenError creates a permission denied error.

func NewInvalidArgsError

func NewInvalidArgsError(message string) *CLIError

NewInvalidArgsError creates a usage/invalid-arguments error.

func NewNetworkError

func NewNetworkError(message string) *CLIError

NewNetworkError creates a network error with retryable hint.

func NewNotFoundError

func NewNotFoundError(message string) *CLIError

NewNotFoundError creates a not found error.

func NewValidationError

func NewValidationError(message string) *CLIError

NewValidationError creates a validation error (mapped to API error).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL