xerrs

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCode

func GetCode(err error, def ...int) int

func GetData

func GetData(err error) xtypes.XMap

Types

type Option

type Option func(*xErr)

func WithCode

func WithCode(code int) Option

func WithData

func WithData(data xtypes.XMap) Option

func WithIgnore added in v0.1.7

func WithIgnore() Option

type Xerror

type Xerror interface {
	GetCode() int
	GetData() xtypes.XMap
	Error() string
}

func New

func New(err error, opts ...Option) Xerror

func NewCode

func NewCode(code int, err error, opts ...Option) Xerror

func Newf

func Newf(f string, args ...interface{}) Xerror

Newf 创建错误对象

Jump to

Keyboard shortcuts

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