errorx

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MulanPSL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const ERRNO_BUSY int32 = 3 // system busy
View Source
const ERRNO_INTERNAL int32 = 5 // 系统内部错误
View Source
const ERRNO_INVAL int32 = 2 // Invalid argument
View Source
const ERRNO_NOTEXIST int32 = 4 // 结果不存在
View Source
const ERRNO_OK int32 = 0 //成功

1000以内为通用定义,1000以上请自定义

View Source
const ERRNO_PERM int32 = 1 // 没有权限
View Source
const ERRNO_TIMEOUT int32 = 6 // 请求超时
View Source
const ERRNO_UNKNOWN int32 = 999 // 未知错误 不可重试

Variables

This section is empty.

Functions

func IsCodeErr

func IsCodeErr(code int32) bool

func MapErrMsg

func MapErrMsg(code int32) string

Types

type CodeError

type CodeError struct {
	Code int32  `json:"code"`
	Msg  string `json:"msg"`
}

func NewCodeErr

func NewCodeErr(code int32, err error) *CodeError

func NewErrCode

func NewErrCode(code int32) *CodeError

func NewErrCodeMsg

func NewErrCodeMsg(code int32, msg string) *CodeError

func NewErrMsg

func NewErrMsg(msg string) *CodeError

func (*CodeError) Error

func (e *CodeError) Error() string

func (*CodeError) GetErrCode

func (e *CodeError) GetErrCode() int32

func (*CodeError) GetMsg

func (e *CodeError) GetMsg() string

Jump to

Keyboard shortcuts

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