errors

package
v0.0.0-...-512269d Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented     = errors.New("not implemented")
	ErrNoExtension        = errors.New("missing extension")
	ErrNoLogger           = errors.New("missing logger")
	ErrNoLogSource        = errors.New("missing log source")
	ErrUndefined          = errors.New("undefined")
	ErrInvalidDestination = errors.New("invalid destination")
	ErrTimeout            = errors.New("timeout")
	ErrLocked             = errors.New("locked")
	ErrStaleLock          = errors.New("stale lock")
	ErrExists             = errors.New("already exists")
	ErrNotFound           = errors.New("not found")
	ErrUnsupported        = errors.New("unsupported")
	ErrUnavailable        = errors.New("unavailable")
)

Functions

func ParseErrorSource

func ParseErrorSource(str string) (string, string, bool)

func WrapError

func WrapError(err error) error

WrapError ErrorStack 获取错误堆栈

Types

type CodeError

type CodeError struct {
	Code    int
	Message string
	Data    interface{}
}

CodeError WebCode Error

func FromError

func FromError(err error) *CodeError

func NewError

func NewError(code int, text string) *CodeError

func NewErrorData

func NewErrorData(code int, text string, data interface{}) *CodeError

func NewErrorMsg

func NewErrorMsg(text string) *CodeError

func (*CodeError) Error

func (e *CodeError) Error() string

type MapError

type MapError map[string]interface{}

MapError Map格式的错误

func (*MapError) Add

func (e *MapError) Add(field string, msg interface{}) *MapError

type SimpError

type SimpError struct {
	Message string
}

SimpError 简单错误

func New

func New(a ...interface{}) *SimpError

New 新建SimpleError

func (*SimpError) Error

func (e *SimpError) Error() string

Jump to

Keyboard shortcuts

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