Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthenticationError

func NewAuthenticationError(message string) error

NewAuthenticationError creates a new authentication error.

func NewNetworkError

func NewNetworkError(message string) error

NewNetworkError creates a new network error.

func NewNotFoundError

func NewNotFoundError(message string) error

NewNotFoundError creates a new not found error.

func NewParseError

func NewParseError(message string) error

NewParseError creates a new parse error.

func NewRateLimitError

func NewRateLimitError(message string) error

NewRateLimitError creates a new rate limit error.

func NewValidationError

func NewValidationError(message string) error

NewValidationError creates a new validation error.

func WrapError

func WrapError(err error, errorType ErrorType, message string) error

WrapError wraps an error with a type and message.

Types

type ErrorType

type ErrorType int

ErrorType represents the type of error.

const (
	// ErrorTypeUnknown represents an unknown error.
	ErrorTypeUnknown ErrorType = iota
	// ErrorTypeAuthentication represents authentication errors.
	ErrorTypeAuthentication
	// ErrorTypeRateLimit represents rate limit errors.
	ErrorTypeRateLimit
	// ErrorTypeNotFound represents not found errors.
	ErrorTypeNotFound
	// ErrorTypeParse represents parsing errors.
	ErrorTypeParse
	// ErrorTypeNetwork represents network errors.
	ErrorTypeNetwork
	// ErrorTypeValidation represents validation errors.
	ErrorTypeValidation
)

type TypedError

type TypedError interface {
	error
	Type() ErrorType
}

TypedError is an error with a type.

Jump to

Keyboard shortcuts

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