Documentation ¶
Index ¶
- func As[E error](err error) (e E, _ bool)
- func EmptyFieldError(field string) error
- func ErrInvalidf(format string, args ...interface{}) error
- func ErrNotFoundf(format string, args ...interface{}) error
- func InvalidFieldError(field, reason string) error
- func New(s string) error
- type ErrInvalid
- type ErrNotFound
- type ErrValidation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func As ¶ added in v1.16.0
As is a utility for one-lining errors.As statements. e.g. cerr, match := errors.As[MyCustomError](err).
func EmptyFieldError ¶
EmptyFieldError creates an ErrInvalidField for an empty field
func ErrInvalidf ¶
ErrInvalidf creates an ErrInvalid using a custom format
func ErrNotFoundf ¶
ErrNotFoundf creates an ErrNotFound using a custom format
func InvalidFieldError ¶
InvalidFieldError creates an ErrInvalidField for a specific field and reason
Types ¶
type ErrInvalid ¶
type ErrInvalid string
ErrInvalid represents an invalid error
func (ErrInvalid) Error ¶
func (e ErrInvalid) Error() string
type ErrNotFound ¶
type ErrNotFound string
ErrNotFound represents a not found error
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type ErrValidation ¶
type ErrValidation struct {
// contains filtered or unexported fields
}
ErrValidation is a validation error for a specific field and reason
func (ErrValidation) Error ¶
func (e ErrValidation) Error() string
Click to show internal directories.
Click to hide internal directories.