ringerrors

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClassifyHTTPError

func ClassifyHTTPError(resp *http.Response, body string) error

ClassifyHTTPError preserves the status-bearing HTTPError while also exposing the most specific public error family for common response codes.

func IsAuthenticationError

func IsAuthenticationError(err error) bool

IsAuthenticationError checks if an error is an AuthenticationError

func IsBadRequestError

func IsBadRequestError(err error) bool

IsBadRequestError checks if an error is a BadRequestError

func IsClosedError

func IsClosedError(err error) bool

IsClosedError checks if an error is a ClosedError

func IsConnectionError

func IsConnectionError(err error) bool

IsConnectionError checks if an error is a ConnectionError

func IsHTTPError

func IsHTTPError(err error) bool

IsHTTPError checks if an error is an HTTPError

func IsHTTPStatusCode

func IsHTTPStatusCode(err error, code int) bool

IsHTTPStatusCode checks if an error is an HTTPError with a specific status code

func IsInternalServerError

func IsInternalServerError(err error) bool

IsInternalServerError checks if an error is a InternalServerError

func IsNetworkError

func IsNetworkError(err error) bool

IsNetworkError checks if an error is a NetworkError

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError checks if an error is a NotFoundError

func IsRateLimitError

func IsRateLimitError(err error) bool

func IsRequires2FAError

func IsRequires2FAError(err error) bool

IsRequires2FAError checks if an error is a Requires2FAError

func IsTokenError

func IsTokenError(err error) bool

IsTokenError checks if an error is a TokenError

func IsUnauthorizedError

func IsUnauthorizedError(err error) bool

IsUnauthorizedError checks if an error is a UnauthorizedError

Types

type AuthenticationError

type AuthenticationError struct {
	Message string
	Status  int
}

AuthenticationError represents an authentication failure

func NewAuthenticationError

func NewAuthenticationError(message string, status int) *AuthenticationError

NewAuthenticationError creates a new AuthenticationError

func (*AuthenticationError) Error

func (e *AuthenticationError) Error() string

type BadRequestError

type BadRequestError struct {
	Message string
	Err     error
}

BadRequestError represents a bad request error

func NewBadRequestError

func NewBadRequestError(message string, err error) *BadRequestError

NewBadRequestError creates a new BadRequestError

func (*BadRequestError) Error

func (e *BadRequestError) Error() string

func (*BadRequestError) Unwrap

func (e *BadRequestError) Unwrap() error

type ClosedError

type ClosedError struct {
	Message string
	Err     error
}

ClosedError represents an error when trying to use a closed connection

func NewClosedError

func NewClosedError(message string, cause ...error) *ClosedError

NewClosedError creates a new ClosedError

func (*ClosedError) Error

func (e *ClosedError) Error() string

func (*ClosedError) Unwrap

func (e *ClosedError) Unwrap() error

type ConnectionError

type ConnectionError struct {
	Message string
	Err     error
}

ConnectionError represents a connection failure

func NewConnectionError

func NewConnectionError(message string, err error) *ConnectionError

NewConnectionError creates a new ConnectionError

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

func (*ConnectionError) Unwrap

func (e *ConnectionError) Unwrap() error

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
	Body       string
	Message    string
}

HTTPError represents an HTTP-level error with status code

func NewHTTPError

func NewHTTPError(resp *http.Response, body string) *HTTPError

NewHTTPError creates a new HTTPError from an HTTP response

func (*HTTPError) Error

func (e *HTTPError) Error() string

Error excludes the raw response body, which can contain credentials or personal data. Callers may inspect Body explicitly when handling the error securely.

type InternalServerError

type InternalServerError struct {
	Message string
	Err     error
}

InternalServerError represents an internal server error

func NewInternalServerError

func NewInternalServerError(message string, err error) *InternalServerError

NewInternalServerError creates a new InternalServerError

func (*InternalServerError) Error

func (e *InternalServerError) Error() string

func (*InternalServerError) Unwrap

func (e *InternalServerError) Unwrap() error

type NetworkError

type NetworkError struct {
	Message string
	Err     error
}

NetworkError represents a network-level error

func NewNetworkError

func NewNetworkError(message string, err error) *NetworkError

NewNetworkError creates a new NetworkError

func (*NetworkError) Error

func (e *NetworkError) Error() string

func (*NetworkError) Unwrap

func (e *NetworkError) Unwrap() error

type NotFoundError

type NotFoundError struct {
	Message string
	Err     error
}

NotFoundError represents a not found error

func NewNotFoundError

func NewNotFoundError(message string, err error) *NotFoundError

NewNotFoundError creates a new NotFoundError

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

type RateLimitError

type RateLimitError struct {
	Message string
	Err     error
}

func NewRateLimitError

func NewRateLimitError(message string) *RateLimitError

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

func (*RateLimitError) Unwrap

func (e *RateLimitError) Unwrap() error

type Requires2FAError

type Requires2FAError struct {
	Message string
}

Requires2FAError represents an error when 2FA is required

func NewRequires2FAError

func NewRequires2FAError(message string) *Requires2FAError

NewRequires2FAError creates a new Requires2FAError

func (*Requires2FAError) Error

func (e *Requires2FAError) Error() string

type TokenError

type TokenError struct {
	Message string
	Err     error
}

TokenError represents a token retrieval or validation error

func NewTokenError

func NewTokenError(message string, err error) *TokenError

NewTokenError creates a new TokenError

func (*TokenError) Error

func (e *TokenError) Error() string

func (*TokenError) Unwrap

func (e *TokenError) Unwrap() error

type UnauthorizedError

type UnauthorizedError struct {
	Message string
	Err     error
}

UnauthorizedError represents an unauthorized error

func NewUnauthorizedError

func NewUnauthorizedError(message string, err error) *UnauthorizedError

NewUnauthorizedError creates a new UnauthorizedError

func (*UnauthorizedError) Error

func (e *UnauthorizedError) Error() string

func (*UnauthorizedError) Unwrap

func (e *UnauthorizedError) Unwrap() error

Jump to

Keyboard shortcuts

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