errors

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSpecification = errors.New("specification must be a struct pointer")
	ErrNotAStruct           = errors.New("cannot wrap a non-struct type")
	ErrNotExported          = errors.New("field is not exported")
	ErrNotSettable          = errors.New("field is not settable")
	ErrMissingRequired      = errors.New("required field is zero valued")
)

Functions

func Join

func Join(err error, errs ...error) error

Types

type InvalidConfig

type InvalidConfig struct {
	// contains filtered or unexported fields
}

Invalid is a field-specific configuration validation error and is returned either by field specification validation or by the user in a custom Validate() method.

func Invalid

func Invalid(conf, field, issue string, args ...any) *InvalidConfig

func Parse

func Parse(conf, field string, err error) *InvalidConfig

func Required

func Required(conf, field string) *InvalidConfig

func Wrap

func Wrap(conf, field, issue string, err error, args ...any) *InvalidConfig

func (*InvalidConfig) Error

func (e *InvalidConfig) Error() string

func (*InvalidConfig) Field

func (e *InvalidConfig) Field() string

func (*InvalidConfig) Is

func (e *InvalidConfig) Is(target error) bool

func (*InvalidConfig) Unwrap

func (e *InvalidConfig) Unwrap() error

type ParseError

type ParseError struct {
	Source string
	Field  string
	Type   string
	Value  string
	Err    error
}

func (*ParseError) Error

func (e *ParseError) Error() string

func (*ParseError) Is

func (e *ParseError) Is(target error) bool

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

type ValidationErrors

type ValidationErrors []*InvalidConfig

func (ValidationErrors) Contains

func (e ValidationErrors) Contains(target error) bool

func (ValidationErrors) Error

func (e ValidationErrors) Error() string

func (ValidationErrors) Is

func (e ValidationErrors) Is(target error) bool

Jump to

Keyboard shortcuts

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