errorx

package
v0.0.0-...-83d3498 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorxMessage

func ErrorxMessage(errorxcode ErrorCode) string

func ParseGrpcError

func ParseGrpcError(err error) error

Types

type ErrorCode

type ErrorCode int32
const (
	SERVER_COMMON_ERROR ErrorCode = 1001 + iota
	REUQEST_PARAM_ERROR
	GRPC_ERROR
	USERPASSWORDERROR
	UNAUTHORIZATION
	USER_PERMISSION_REJECT
	JWT_TOKEN_GENERATE_ERROR
	JWT_TOKEN_PARAM_GET_NERROR
	DB_ERROR
	DB_NOTFOUND
	DB_UPDATE_AFFECTED_ZERO_ERROR

	Validate_RegisterDefaultTranslations_ERROR
)

全局错误码

type Errorx

type Errorx struct {
	Code  ErrorCode
	Msg   string
	Meta  []interface{}
	Cause error
	// contains filtered or unexported fields
}

func New

func New(causeErr error, msg string) *Errorx

func NewByCode

func NewByCode(causeErr error, code ErrorCode) *Errorx

func (*Errorx) Error

func (e *Errorx) Error() string

func (*Errorx) Message

func (e *Errorx) Message() string

func (*Errorx) WithMeta

func (e *Errorx) WithMeta(rpcMethod string, rpcerr string, param interface{}) *Errorx

type MsgErrList

type MsgErrList struct {
	List []interface{}
	// contains filtered or unexported fields
}

func (*MsgErrList) WithMeta

func (e *MsgErrList) WithMeta(rpcMethod string, rpcerr string, param interface{}) *MsgErrList

Jump to

Keyboard shortcuts

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