errors

package
v1.15.10 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 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

This section is empty.

Types

type DuplicateKeyError added in v1.14.1

type DuplicateKeyError struct {
	Message string
	Token   *token.Token
}

func ErrDuplicateKey added in v1.14.1

func ErrDuplicateKey(msg string, tk *token.Token) *DuplicateKeyError

ErrDuplicateKey creates an duplicate key error instance with token.

func (*DuplicateKeyError) Error added in v1.14.1

func (e *DuplicateKeyError) Error() string

func (*DuplicateKeyError) FormatError added in v1.14.1

func (e *DuplicateKeyError) FormatError(colored, inclSource bool) string

type OverflowError added in v1.14.1

type OverflowError struct {
	DstType reflect.Type
	SrcNum  string
	Token   *token.Token
}

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 (*OverflowError) Error added in v1.14.1

func (e *OverflowError) Error() string

func (*OverflowError) FormatError added in v1.14.1

func (e *OverflowError) FormatError(colored, inclSource bool) string

type PrettyFormatError added in v1.14.1

type PrettyFormatError interface {
	FormatError(bool, bool) string
}

type SyntaxError added in v1.14.1

type SyntaxError struct {
	Message string
	Token   *token.Token
}

func ErrSyntax

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

ErrSyntax create syntax error instance with message and token

func (*SyntaxError) Error added in v1.14.1

func (e *SyntaxError) Error() string

func (*SyntaxError) FormatError added in v1.14.1

func (e *SyntaxError) FormatError(colored, inclSource bool) string

type TypeError added in v1.9.6

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

func ErrTypeMismatch added in v1.14.1

func ErrTypeMismatch(dstType, srcType reflect.Type, token *token.Token) *TypeError

ErrTypeMismatch cerates an type mismatch error instance with 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(colored, inclSource bool) string

type UnexpectedNodeTypeError added in v1.14.1

type UnexpectedNodeTypeError struct {
	Actual   ast.NodeType
	Expected ast.NodeType
	Token    *token.Token
}

func ErrUnexpectedNodeType added in v1.14.1

func ErrUnexpectedNodeType(actual, expected ast.NodeType, tk *token.Token) *UnexpectedNodeTypeError

func (*UnexpectedNodeTypeError) Error added in v1.14.1

func (e *UnexpectedNodeTypeError) Error() string

func (*UnexpectedNodeTypeError) FormatError added in v1.14.1

func (e *UnexpectedNodeTypeError) FormatError(colored, inclSource bool) string

type UnknownFieldError added in v1.14.1

type UnknownFieldError struct {
	Message string
	Token   *token.Token
}

func ErrUnknownField added in v1.14.1

func ErrUnknownField(msg string, tk *token.Token) *UnknownFieldError

ErrUnknownField creates an unknown field error instance with token.

func (*UnknownFieldError) Error added in v1.14.1

func (e *UnknownFieldError) Error() string

func (*UnknownFieldError) FormatError added in v1.14.1

func (e *UnknownFieldError) FormatError(colored, inclSource bool) string

Jump to

Keyboard shortcuts

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