error

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeOK              = 0
	CodeInnerError      = -1000
	QueryFailed         = -1001
	ExecFailed          = -1002
	SignatureInvalid    = -1010
	SignatureExpired    = -1011
	ParamsError         = -1012
	RPCFailed           = -1013
	TokenError          = -1014
	DeviceTypeError     = -1015
	ReconnectNotAllowed = -1016

	FeaturesUnSupported = -2000
	VerifyCodeSendError = -4006
	VerifyCodeError     = -4007
	VerifyCodeExpired   = -4008
	QueryNotExist       = -4009
	SendMsgFailed       = -5001

	ExportAddressPhoneInconsistent = -4010
	ExportAddressEmailInconsistent = -4011

	GroupCreateFailed           = -10000
	GroupStatusBlock            = -10001
	GroupStatusDisBand          = -10002
	GroupMemberLimit            = -10003
	GroupInviteMemberFailed     = -10004
	GroupInvitePermissionDenied = -10005
	GroupMemberTypeOther        = -10006
	GroupExit                   = -10007
	GroupRemove                 = -10008
	GroupDisband                = -10009
	GroupInviteNoMembers        = -10010
	GroupRemoveNoMembers        = -10011
	GroupAdminDeny              = -10012
	GroupOwnerDeny              = -10013
	GroupChangeOwner            = -10014
	GroupPersonNotExist         = -10015
	GroupMemberNotExist         = -10016
	GroupChangeOwnerSelf        = -10017
	GroupSetAdmin               = -10018
	GroupAdminNumLimit          = -10019
	GroupNotExist               = -10020
	GroupHigherPermission       = -10021
	GroupOwnerExit              = -10022
	GroupInviteMemberExist      = -10023
	GroupOwnerDisband           = -10024
	GroupOwnerChange            = -10025
	GroupOwnerSetAdmin          = -10026
	GroupMutePermission         = -10027
	GroupApplyUsed              = -10028
	GroupMemberExist            = -10029
	GroupApplyNotExist          = -10030

	CallUserBusy = -10101

	OssFileTooSmall = -10201
	OssFileTooBig   = -10202
	OssKeyIllegal   = -10203

	CdkOutOfStock      = -10301
	CdkOrderError      = -10302
	CdkStatusNotFrozen = -10303
	CdkCoinNameErr     = -10304
	CdkCoinNameExist   = -10305
	CdkMaxNumberErr    = -10306
)
View Source
const (
	DispMsgExt  = 0
	DispJustExt = 1
)

Variables

This section is empty.

Functions

func ErrClientInterceptor

func ErrClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

ErrClientInterceptor 业务错误客户端一元拦截器

func ErrInterceptor

func ErrInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

ErrInterceptor 业务错误服务端一元拦截器

func UnwrapErr

func UnwrapErr(err error) error

UnwrapErr 返回gRPC状态码解包后的业务错误

func WrapErr

func WrapErr(err error) error

WrapErr 返回gRPC状态码包装后的业务错误

Types

type Error

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

func NewError

func NewError(code int) *Error

错误信息组合 1. message + : + extMsg 2. extMsg

func (*Error) Code

func (e *Error) Code() int

func (*Error) Data

func (e *Error) Data() map[string]interface{}

func (*Error) Error

func (e *Error) Error() string

策略返回显示的错误信息

func (*Error) JustShowExtMsg

func (e *Error) JustShowExtMsg() *Error

external

func (*Error) SetChildErr

func (e *Error) SetChildErr(name string, code interface{}, message interface{}) *Error

data["service"]=service name data["code"]=code data["message"]=message

func (*Error) SetExtMessage

func (e *Error) SetExtMessage(extMsg string) *Error

func (*Error) WriteCode

func (e *Error) WriteCode(code interface{}) *Error

func (*Error) WriteMessage

func (e *Error) WriteMessage(msg interface{}) *Error

Jump to

Keyboard shortcuts

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