customerrors

package
v0.5.502 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidJSON = errors.New("invalid JSON file")
	ErrInvalidFile = errors.New("invalid file")
	ErrInterrupt   = errors.New("interrupted")
	ErrNoInternet  = errors.New("no internet connection")
	ErrTimeout     = errors.New("timeout")
)

Functions

func As

func As(err error, target any) bool

func Is

func Is(err, target error) bool

func OSErrorFormater

func OSErrorFormater(err error) error

func RequestErrorsFormater

func RequestErrorsFormater(err error) string

func ValidationErrorsFormater

func ValidationErrorsFormater(errs validator.ValidationErrors) error

Types

type Error

type Error interface {
	Error() string
	Unwrap() error
}

type FileNotFoundError

type FileNotFoundError struct {
	FileName string
	// contains filtered or unexported fields
}

func NewFileNotFoundError

func NewFileNotFoundError(fileName string, err error) *FileNotFoundError

func (*FileNotFoundError) Error

func (e *FileNotFoundError) Error() string

func (*FileNotFoundError) Unwrap

func (e *FileNotFoundError) Unwrap() error

type InvalidFileError

type InvalidFileError struct {
	FileName string
	// contains filtered or unexported fields
}

func NewInvalidFileError

func NewInvalidFileError(fileName string, err error) *InvalidFileError

func (*InvalidFileError) Error

func (e *InvalidFileError) Error() string

func (*InvalidFileError) Unwrap

func (e *InvalidFileError) Unwrap() error

type TypeError

type TypeError struct {
	Expected string
	Received string
	Field    string
	// contains filtered or unexported fields
}

func NewTypeError

func NewTypeError(expected, received, field string, err error) *TypeError

func (*TypeError) Error

func (e *TypeError) Error() string

func (*TypeError) Unwrap

func (e *TypeError) Unwrap() error

type ValidationErrors

type ValidationErrors struct {
	MapErrors map[string]string
	// contains filtered or unexported fields
}

func NewValidationErrors

func NewValidationErrors(errsMap map[string]string, errs validator.ValidationErrors) *ValidationErrors

func (*ValidationErrors) Error

func (errs *ValidationErrors) Error() string

func (*ValidationErrors) Unwrap

func (errs *ValidationErrors) Unwrap() error

Jump to

Keyboard shortcuts

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