errors

package
v0.0.0-...-377a6f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Break

func Break() error

func Continue

func Continue() error

func Error

func Error(pos lexer.Position, err error) error

Error wraps an error with the lexer.Position. If IsError(err) returns true then that error is returned. If err is nil then nil is returned. IsError will return true for a non-nil result from this function.

func Errorf

func Errorf(pos lexer.Position, f string, a ...interface{}) error

Errorf returns an error containing the lexer.Position and the formatted message. IsError with this error will return true.

func IsBreak

func IsBreak(err error) bool

IsBreak returns true if err is from a break instruction being invoked.

func IsContinue

func IsContinue(err error) bool

IsContinue returns true if err is from a continue instruction being invoked.

func IsError

func IsError(err error) bool

IsError returns true if the error is from Errorf or Error functions.

func IsNoFieldErr

func IsNoFieldErr(err error) bool

func IsReturn

func IsReturn(err error) bool

func NewReturn

func NewReturn(v interface{}) error

func NoField

func NoField(pos lexer.Position, v interface{}, n string) error

Types

type NoFieldError

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

func GetNoFieldErr

func GetNoFieldErr(err error) (*NoFieldError, bool)

func (*NoFieldError) Error

func (e *NoFieldError) Error() string

func (*NoFieldError) Name

func (e *NoFieldError) Name() string

func (*NoFieldError) Value

func (e *NoFieldError) Value() interface{}

type ReturnError

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

func (*ReturnError) Error

func (r *ReturnError) Error() string

func (*ReturnError) Value

func (r *ReturnError) Value() interface{}

Jump to

Keyboard shortcuts

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