yerrors

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecodeRequiredPointerType = errors.New("required pointer type value")
)

Functions

func ErrSyntax

func ErrSyntax(msg string, tk *token.Token) *syntaxError

ErrSyntax create syntax error instance with message and token

func Wrapf

func Wrapf(err error, msg string, args ...interface{}) error

Wrapf wrap error for stack trace

Types

type FormatErrorPrinter

type FormatErrorPrinter struct {
	xerrors.Printer
	Colored    bool
	InclSource bool
}

type PrettyPrinter

type PrettyPrinter interface {
	PrettyPrint(xerrors.Printer, bool, bool) error
}

type Sink

type Sink struct{ *bytes.Buffer }

func (*Sink) Detail

func (es *Sink) Detail() bool

func (*Sink) Print

func (es *Sink) Print(args ...interface{})

func (*Sink) Printf

func (es *Sink) Printf(f string, args ...interface{})

type TypeError

type TypeError struct {
	DstType         reflect.Type
	SrcType         reflect.Type
	StructFieldName *string
	Token           *token.Token
}

func (*TypeError) Error

func (e *TypeError) Error() string

func (*TypeError) FormatError

func (e *TypeError) FormatError(p xerrors.Printer) error

func (*TypeError) PrettyPrint

func (e *TypeError) PrettyPrint(p xerrors.Printer, colored, inclSource bool) error

Jump to

Keyboard shortcuts

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