errors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotAuthenticated indicates the user is not authenticated
	ErrNotAuthenticated = errors.New("not authenticated: please run 'cu auth login'")

	// ErrTokenExpired indicates the authentication token has expired
	ErrTokenExpired = errors.New("authentication token expired: please run 'cu auth login' again")

	// ErrInvalidToken indicates the token is invalid
	ErrInvalidToken = errors.New("invalid authentication token")

	// ErrNetworkError indicates a network error occurred
	ErrNetworkError = errors.New("network error")

	// ErrRateLimited indicates the API rate limit was exceeded
	ErrRateLimited = errors.New("rate limit exceeded")

	// ErrNotFound indicates the requested resource was not found
	ErrNotFound = errors.New("resource not found")

	// ErrInvalidInput indicates invalid user input
	ErrInvalidInput = errors.New("invalid input")

	// ErrConfigNotFound indicates the configuration was not found
	ErrConfigNotFound = errors.New("configuration not found")
)

Error types

Functions

func HandleHTTPError

func HandleHTTPError(statusCode int, body string) error

HandleHTTPError converts HTTP status codes to appropriate errors

func IsRetryable

func IsRetryable(err error) bool

IsRetryable determines if an error is retryable

Types

type APIError

type APIError struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
	Details    string `json:"details,omitempty"`
}

APIError represents an error from the ClickUp API

func NewAPIError

func NewAPIError(statusCode int, message string, details ...string) *APIError

NewAPIError creates a new API error

func (*APIError) Error

func (e *APIError) Error() string

type UserError

type UserError struct {
	Message    string
	Suggestion string
	Err        error
}

UserError represents a user-friendly error message

func NewUserError

func NewUserError(message, suggestion string, err error) *UserError

NewUserError creates a new user-friendly error

func (*UserError) Error

func (e *UserError) Error() string

func (*UserError) Unwrap

func (e *UserError) Unwrap() error

Jump to

Keyboard shortcuts

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