5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-26 21:25:39 +00:00
matterbridge/vendor/github.com/d5/tengo/v2/errors.go
2020-01-09 21:52:19 +01:00

65 lines
2.0 KiB
Go

package tengo
import (
"errors"
"fmt"
)
var (
// ErrStackOverflow is a stack overflow error.
ErrStackOverflow = errors.New("stack overflow")
// ErrObjectAllocLimit is an objects allocation limit error.
ErrObjectAllocLimit = errors.New("object allocation limit exceeded")
// ErrIndexOutOfBounds is an error where a given index is out of the
// bounds.
ErrIndexOutOfBounds = errors.New("index out of bounds")
// ErrInvalidIndexType represents an invalid index type.
ErrInvalidIndexType = errors.New("invalid index type")
// ErrInvalidIndexValueType represents an invalid index value type.
ErrInvalidIndexValueType = errors.New("invalid index value type")
// ErrInvalidIndexOnError represents an invalid index on error.
ErrInvalidIndexOnError = errors.New("invalid index on error")
// ErrInvalidOperator represents an error for invalid operator usage.
ErrInvalidOperator = errors.New("invalid operator")
// ErrWrongNumArguments represents a wrong number of arguments error.
ErrWrongNumArguments = errors.New("wrong number of arguments")
// ErrBytesLimit represents an error where the size of bytes value exceeds
// the limit.
ErrBytesLimit = errors.New("exceeding bytes size limit")
// ErrStringLimit represents an error where the size of string value
// exceeds the limit.
ErrStringLimit = errors.New("exceeding string size limit")
// ErrNotIndexable is an error where an Object is not indexable.
ErrNotIndexable = errors.New("not indexable")
// ErrNotIndexAssignable is an error where an Object is not index
// assignable.
ErrNotIndexAssignable = errors.New("not index-assignable")
// ErrNotImplemented is an error where an Object has not implemented a
// required method.
ErrNotImplemented = errors.New("not implemented")
)
// ErrInvalidArgumentType represents an invalid argument value type error.
type ErrInvalidArgumentType struct {
Name string
Expected string
Found string
}
func (e ErrInvalidArgumentType) Error() string {
return fmt.Sprintf("invalid type for argument '%s': expected %s, found %s",
e.Name, e.Expected, e.Found)
}