Documentation ¶
Index ¶
- Constants
- func ErrClientInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func ErrInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func UnwrapErr(err error) error
- func WrapErr(err error) error
- type Error
- func (e *Error) Code() int
- func (e *Error) Data() map[string]interface{}
- func (e *Error) Error() string
- func (e *Error) JustShowExtMsg() *Error
- func (e *Error) SetChildErr(name string, code interface{}, message interface{}) *Error
- func (e *Error) SetExtMessage(extMsg string) *Error
- func (e *Error) WriteCode(code interface{}) *Error
- func (e *Error) WriteMessage(msg interface{}) *Error
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 业务错误服务端一元拦截器
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) SetChildErr ¶
data["service"]=service name data["code"]=code data["message"]=message
func (*Error) SetExtMessage ¶
func (*Error) WriteMessage ¶
Click to show internal directories.
Click to hide internal directories.