Documentation
¶
Index ¶
- func As(err error, target any) bool
- func Is(err, target error) bool
- func IsBadRequest(err error) bool
- func IsForbidden(err error) bool
- func IsInternalServerError(err error) bool
- func IsNotFound(err error) bool
- func IsRequestError(err error) bool
- func IsUnauthorized(err error) bool
- func New(message string) error
- func Unwrap(err error) error
- type BadRequest
- type Forbidden
- type InternalServerError
- type NotFound
- type RequestError
- type Unauthorized
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBadRequest ¶
func IsForbidden ¶
func IsInternalServerError ¶
func IsNotFound ¶
func IsRequestError ¶
func IsUnauthorized ¶
Types ¶
type BadRequest ¶
type BadRequest struct {
Message string `json:"message"`
}
BadRequest represents a 400 error.
func NewBadRequest ¶
func NewBadRequest(message string, args ...any) *BadRequest
func (*BadRequest) Error ¶
func (b *BadRequest) Error() string
type Forbidden ¶
type Forbidden struct {
Message string `json:"message"`
}
Forbidden represents a 403 error.
func NewForbidden ¶
type InternalServerError ¶
type InternalServerError struct {
Message string `json:"message"`
}
InternalServerError represents a 500 error.
func NewInternalServerError ¶
func NewInternalServerError(message string, args ...any) *InternalServerError
func (*InternalServerError) Error ¶
func (i *InternalServerError) Error() string
type NotFound ¶
type NotFound struct {
Message string `json:"message"`
}
NotFound represents a 404 error.
func NewNotFound ¶
type RequestError ¶
type RequestError struct {
// contains filtered or unexported fields
}
func NewRequestError ¶
func NewRequestError(err error) *RequestError
func NewRequestErrorf ¶
func NewRequestErrorf(format string, args ...any) *RequestError
func (*RequestError) Error ¶
func (r *RequestError) Error() string
func (*RequestError) RawURL ¶
func (r *RequestError) RawURL() string
func (*RequestError) StatusCode ¶
func (r *RequestError) StatusCode() int
func (*RequestError) Unwrap ¶
func (r *RequestError) Unwrap() error
func (*RequestError) WithRawURL ¶
func (r *RequestError) WithRawURL(rawURL string) *RequestError
func (*RequestError) WithStatusCode ¶
func (r *RequestError) WithStatusCode(statusCode int) *RequestError
type Unauthorized ¶
type Unauthorized struct {
}
Unauthorized represents a 401 error.
func NewUnauthorized ¶
func NewUnauthorized(message string, args ...any) *Unauthorized
func (*Unauthorized) Error ¶
func (u *Unauthorized) Error() string
Click to show internal directories.
Click to hide internal directories.