errors

package
v1.0.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrorTypeParsingException         = "parsing_exception"
	ErrorTypeXContentParseException   = "x_content_parse_exception"
	ErrorTypeIllegalArgumentException = "illegal_argument_exception"
	ErrorTypeRuntimeException         = "runtime_exception"
	ErrorTypeNotImplemented           = "not_implemented"
	ErrorTypeInvalidArgument          = "invalid_argument"
)

Variables

View Source
var (
	ErrCancelSignal = errors.New("cancelled") // just for cancel notice
	ErrNotFound     = errors.New("not found")
	ErrKeyNotFound  = errors.New("key not found")
	ErrKeyEmpty     = errors.New("key is be empty")
)
View Source
var ErrorIDNotFound = errors.New("id not found")

Functions

func As

func As(err error, target interface{}) bool

func HandleError

func HandleError(c zhttp.Context, err error)

func Is

func Is(err, target error) bool

Types

type Error

type Error struct {
	Type     string `json:"type"`
	Reason   string `json:"reason"`
	CausedBy error  `json:"caused_by,omitempty"`
}

func New

func New(errType string, errReason string) *Error

func (*Error) Cause

func (e *Error) Cause(err error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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