xerr

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DB_ERROR int64 = -100005
View Source
const DB_UPDATE_AFFECTED_ZERO_ERROR int64 = -100006
View Source
const OK int64 = 0

成功返回

View Source
const REUQEST_PARAM_ERROR int64 = -100002
View Source
const SERVER_COMMON_ERROR int64 = -100001

前3位代表业务,后三位代表具体功能

View Source
const TOKEN_EXPIRE_ERROR int64 = -100003
View Source
const TOKEN_GENERATE_ERROR int64 = -100004

Variables

This section is empty.

Functions

func IsCodeErr

func IsCodeErr(errcode int64) bool

func MapErrMsg

func MapErrMsg(errcode int64) string

Types

type BioError added in v0.1.7

type BioError interface {
	GetErrCode() int64
	GetErrMsg() string
	Error() string
}

type CodeError

type CodeError struct {
	// contains filtered or unexported fields
}

常用通用固定错误

func NewErrCode

func NewErrCode(errCode int64) *CodeError

func NewErrCodeMsg

func NewErrCodeMsg(errCode int64, errMsg string) *CodeError

func NewErrMsg

func NewErrMsg(errMsg string) *CodeError

func (*CodeError) Data

func (e *CodeError) Data() *CodeErrorResponse

func (*CodeError) Error

func (e *CodeError) Error() string

func (*CodeError) GetErrCode

func (e *CodeError) GetErrCode() int64

返回给前端的错误码

func (*CodeError) GetErrMsg

func (e *CodeError) GetErrMsg() string

返给前端显示错误信息

type CodeErrorResponse

type CodeErrorResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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