Documentation
¶
Index ¶
- func ClassifyHTTPError(resp *http.Response, body string) error
- func IsAuthenticationError(err error) bool
- func IsBadRequestError(err error) bool
- func IsClosedError(err error) bool
- func IsConnectionError(err error) bool
- func IsHTTPError(err error) bool
- func IsHTTPStatusCode(err error, code int) bool
- func IsInternalServerError(err error) bool
- func IsNetworkError(err error) bool
- func IsNotFoundError(err error) bool
- func IsRateLimitError(err error) bool
- func IsRequires2FAError(err error) bool
- func IsTokenError(err error) bool
- func IsUnauthorizedError(err error) bool
- type AuthenticationError
- type BadRequestError
- type ClosedError
- type ConnectionError
- type HTTPError
- type InternalServerError
- type NetworkError
- type NotFoundError
- type RateLimitError
- type Requires2FAError
- type TokenError
- type UnauthorizedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyHTTPError ¶
ClassifyHTTPError preserves the status-bearing HTTPError while also exposing the most specific public error family for common response codes.
func IsAuthenticationError ¶
IsAuthenticationError checks if an error is an AuthenticationError
func IsBadRequestError ¶
IsBadRequestError checks if an error is a BadRequestError
func IsClosedError ¶
IsClosedError checks if an error is a ClosedError
func IsConnectionError ¶
IsConnectionError checks if an error is a ConnectionError
func IsHTTPStatusCode ¶
IsHTTPStatusCode checks if an error is an HTTPError with a specific status code
func IsInternalServerError ¶
IsInternalServerError checks if an error is a InternalServerError
func IsNetworkError ¶
IsNetworkError checks if an error is a NetworkError
func IsNotFoundError ¶
IsNotFoundError checks if an error is a NotFoundError
func IsRateLimitError ¶
func IsRequires2FAError ¶
IsRequires2FAError checks if an error is a Requires2FAError
func IsTokenError ¶
IsTokenError checks if an error is a TokenError
func IsUnauthorizedError ¶
IsUnauthorizedError checks if an error is a UnauthorizedError
Types ¶
type AuthenticationError ¶
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 ¶
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 ¶
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 ¶
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 ¶
HTTPError represents an HTTP-level error with status code
func NewHTTPError ¶
NewHTTPError creates a new HTTPError from an HTTP response
type InternalServerError ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 {
}
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