oerr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code uint
const (
	// DBErr 2 数据库错误
	//		-1 系统错误
	// 		-2 数据读写错误
	DBErr                 Code = 20001
	ResourceCreatedFailed Code = 22012
	ResourceDuplicated    Code = 22021
	ResourceNotExist      Code = 22031
)
const (
	// LogicErr 3 系统内逻辑错误
	LogicErr   Code = 30000
	AppNotJoin Code = 30001
)
const (
	// NotLogin
	// 4 权限类型错误
	// 1: 登录权限
	// 2: 资源操作权限
	NotLogin        Code = 41001
	LoginExpired    Code = 41011
	PassError       Code = 41021
	DisableLogin    Code = 41031
	AccountNotExist Code = 41041
	NoAuth          Code = 42011
)
const (
	MethodNotSupport Code = 61111
	MethodNotAllowed Code = 61121

	ApiArgsError     Code = 62001
	ApiArgsMissing   Code = 62011
	TableArgsMissing Code = 62021
	TableArgsErr     Code = 62031

	FuncArgsError        Code = 63001
	UrlPatternNotSupport Code = 63117
	UrlDefinedDuplicate  Code = 63127
	UrlParamDuplicate    Code = 63137

	DataError Code = 64009
)

6 参数类型错误

-1: 协议参数
-2: 接口参数
-3: 函数参数
-4: 数据依赖错误
const (
	AccessErr     Code = 71001
	AccessTooFast Code = 71010
)
const (
	Unknown Code = 0
)

Unknown error

func OfType

func OfType(errMsg string) Code

func (Code) Attach

func (c Code) Attach(errs ...error) (e error)

Attach 附加错误详细原因

func (Code) AttachStr

func (c Code) AttachStr(errs ...string) (e error)

func (Code) Error

func (c Code) Error() string

func (Code) String

func (c Code) String() string

Jump to

Keyboard shortcuts

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