errors

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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 *gin.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