Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errors ¶
func Errors[T comparable](m []ValidationError[T]) []error
func WrapErrors ¶
Types ¶
type DjangoError ¶
type Error ¶
type Error string
const ( // Generic errors ErrFieldRequired Error = "Required field cannot be empty" ErrInvalidSyntax Error = "Invalid syntax for value" ErrInvalidType Error = "Invalid type provided" ErrInvalidValue Error = "Invalid value provided" ErrLengthMin Error = "Minimum length not met" ErrLengthMax Error = "Maximum length exceeded" ErrUnknown Error = "Unknown error occurred" )
type MultiError ¶
type MultiError struct {
Errors []error
}
func NewMultiError ¶
func NewMultiError(errs ...error) *MultiError
func (*MultiError) Append ¶
func (m *MultiError) Append(err error)
func (*MultiError) As ¶
func (m *MultiError) As(target interface{}) bool
func (*MultiError) Error ¶
func (m *MultiError) Error() string
func (*MultiError) Is ¶
func (m *MultiError) Is(target error) bool
func (*MultiError) Len ¶
func (m *MultiError) Len() int
func (*MultiError) MarshalJSON ¶
func (m *MultiError) MarshalJSON() ([]byte, error)
func (*MultiError) Unwrap ¶
func (m *MultiError) Unwrap() []error
type ValidationError ¶
type ValidationError[T comparable] struct { Name T Err error }
func NewValidationError ¶
func NewValidationError[T comparable](name T, err any) ValidationError[T]
func (ValidationError[T]) DjangoError ¶
func (e ValidationError[T]) DjangoError()
func (ValidationError[T]) Error ¶
func (e ValidationError[T]) Error() string
func (ValidationError[T]) Is ¶
func (e ValidationError[T]) Is(other error) bool
func (ValidationError[T]) MarshalJSON ¶
func (e ValidationError[T]) MarshalJSON() ([]byte, error)
type WithMessage ¶
type WithMessage struct {
// contains filtered or unexported fields
}
func (*WithMessage) Error ¶
func (w *WithMessage) Error() string
func (*WithMessage) Is ¶
func (w *WithMessage) Is(other error) bool
func (*WithMessage) Unwrap ¶
func (w *WithMessage) Unwrap() error
Click to show internal directories.
Click to hide internal directories.