errors

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	As  = errors.As
	Is  = errors.Is
	New = errors.New
)

Functions

func ErrOverflow added in v1.13.0

func ErrOverflow(dstType reflect.Type, num string, tk *token.Token) *overflowError

ErrOverflow creates an overflow error instance with message and a token.

func ErrSyntax

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

ErrSyntax create syntax error instance with message and token

Types

type FormatErrorPrinter added in v1.9.6

type FormatErrorPrinter struct {
	Printer
	Colored    bool
	InclSource bool
}

type PrettyPrinter

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

type Printer added in v1.13.0

type Printer interface {
	// Print appends args to the message output.
	Print(args ...any)
}

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 added in v1.9.6

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

func (*TypeError) Error added in v1.9.6

func (e *TypeError) Error() string

func (*TypeError) FormatError added in v1.9.6

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

func (*TypeError) PrettyPrint added in v1.9.6

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

Jump to

Keyboard shortcuts

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