errors

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 8 Imported by: 134

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSyntaxError       = errors.New("syntax error")
	ErrSemanticError     = errors.New("semantic error")
	ErrParseError        = errors.New("parse error")
	ErrVerificationError = errors.New("verification error")
	ErrValidationError   = errors.New("validation error")
	ErrConversionNotOk   = errors.New("conversion not ok")
	ErrBadSplit          = errors.New("bad split")
	ErrNotInContext      = errors.New("not in context")
	ErrZeroValue         = errors.New("zero value")
	ErrNotInMap          = errors.New("not in map")
	ErrMapZeroValue      = errors.New("map zero value")
	ErrUnexpectedType    = errors.New("unexpected type")
	ErrUnauthorized      = errors.New("unauthorized")
)

Functions

func CaptureStackTrace

func CaptureStackTrace() string

func CollectWrappedErrors

func CollectWrappedErrors(err error) []error

func IsAll

func IsAll(err error, targets ...error) bool

func IsAny

func IsAny(err error, targets ...error) bool

func IsClosedError

func IsClosedError(err error) bool

Types

type CauseErrorI

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

type CodeErrorI

type CodeErrorI interface {
	Error() string
	GetCode() string
}

type ContextErrorI

type ContextErrorI interface {
	Error() string
	GetContext() *context.Context
}

type Error

type Error struct {
	Message    string
	Cause      error
	Input      any
	Code       string
	Id         string
	StackTrace string
}

func (*Error) Error

func (err *Error) Error() string

func (*Error) GetCause

func (err *Error) GetCause() error

func (*Error) GetCode

func (err *Error) GetCode() string

func (*Error) GetId

func (err *Error) GetId() string

func (*Error) GetInput

func (err *Error) GetInput() any

func (*Error) GetStackTrace

func (err *Error) GetStackTrace() string

func (*Error) Is

func (err *Error) Is(target error) bool

func (*Error) Unwrap

func (err *Error) Unwrap() error

type ExtendedError

type ExtendedError struct {
	Input      any
	Code       string
	Id         string
	StackTrace string
	Context    *context.Context
	// contains filtered or unexported fields
}

func New

func New(e any, input ...any) *ExtendedError

func NewCtx

func NewCtx(ctx context.Context, e any, input ...any) *ExtendedError

func NewWithTrace

func NewWithTrace(e any, input ...any) *ExtendedError

func NewWithTraceCtx

func NewWithTraceCtx(ctx context.Context, e any, input ...any) *ExtendedError

func (*ExtendedError) As

func (err *ExtendedError) As(target any) bool

func (*ExtendedError) Error

func (err *ExtendedError) Error() string

func (*ExtendedError) GetCode

func (err *ExtendedError) GetCode() string

func (*ExtendedError) GetContext

func (err *ExtendedError) GetContext() *context.Context

func (*ExtendedError) GetId

func (err *ExtendedError) GetId() string

func (*ExtendedError) GetInput

func (err *ExtendedError) GetInput() any

func (*ExtendedError) GetStackTrace

func (err *ExtendedError) GetStackTrace() string

func (*ExtendedError) Is

func (err *ExtendedError) Is(target error) bool

func (*ExtendedError) Unwrap

func (err *ExtendedError) Unwrap() []error

type IdErrorI

type IdErrorI interface {
	Error() string
	GetId() string
}

type InputErrorI

type InputErrorI interface {
	Error() string
	GetInput() any
}

type StackTraceErrorI

type StackTraceErrorI interface {
	Error() string
	GetStackTrace() string
}

Directories

Path Synopsis
types

Jump to

Keyboard shortcuts

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