errors

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgumentAtLeast

func ArgumentAtLeast(name string, least int) error

func ArgumentMustEmpty

func ArgumentMustEmpty(name string, args []value.Value) error

func ArgumentNotEnough

func ArgumentNotEnough(name string, expects int, args []value.Value) error

func ArgumentNotInRange

func ArgumentNotInRange(name string, minArgs, maxArgs int, args []value.Value) error

func New

func New(name, format string, args ...any) error

func NotImplemented

func NotImplemented(name string) error

func TypeMismatch

func TypeMismatch(name string, num int, expects, actual value.Type) error

Types

type AssertionError

type AssertionError struct {
	// Token info will be injected by interpreter
	Token   token.Token
	Actual  value.Value
	Message string
}

func NewAssertionError

func NewAssertionError(actual value.Value, format string, args ...any) *AssertionError

func (*AssertionError) Error

func (e *AssertionError) Error() string

type TestingError

type TestingError struct {
	// Token info will be injected on interpreter
	Token   token.Token
	Message string
}

Testing related errors

func NewTestingError

func NewTestingError(format string, args ...any) *TestingError

func (*TestingError) Error

func (e *TestingError) Error() string

Jump to

Keyboard shortcuts

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