Documentation
¶
Index ¶
- Constants
- func ComposeHttpAck(code int, msg string, data interface{}) interface{}
- func ComposeWsError(err error) ([]byte, error)
- func ParseError(errcode int, msg string) string
- type Error
- 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
- type WsError
Constants ¶
View Source
const ( ServiceChat = "Chat" ServiceRP = "Redpacket" ServiceCoin = "Bcoin" )
View Source
const ( DispMsgExt = 0 DispJustExt = 1 )
View Source
const ( CodeOK = 0 //ServerResponseFailed = -100 //TokenFailed = -101 DbConnectFail = -1000 ParamsError = -1001 LackParam = -1002 SessionError = -1003 LoginExpired = -1004 MsgFormatError = -1005 UnknowDeviceType = -1006 UserLoginOtherDevice = -1007 LackHeader = -1008 ServiceReqFailed = -1009 QueryDbFailed = -1010 WriteDbFailed = -1011 TooManyRequests = -1012 DbParamsError = -1013 AdminExportFailed = -1014 AdminLoginFailed = -1015 AdminAdNumbersLimit = -1016 AdUploadFailed = -1017 AppUpdateFailed = -1018 RequestHeaderError = -1019 VerifyLimit = -1020 UserNotExists = -2001 UserExists = -2002 CSExists = -2003 TokenLoginFailed = -2004 VisitAccountSystemFailed = -2005 UserSendSysMsg = -2006 UserMuted = -2007 VisitorSendMsg = -2008 SendPrivMsg = -2009 UserIsServed = -2010 JoinListenFailed = -2011 ZhaobiInteractFailed = -2013 SendPrivMsgBtwCS = -2014 VisitorOffline = -2015 NoCSOnline = -2016 IsFriendAlready = -2017 IsNotFriend = -2018 FriendRequestHadDeal = -2019 NotExistFriendRequest = -2020 CanNotOperateSelf = -2021 ConvFail = -2022 DeleteMsgFailed = -2023 CanNotDelMsgOverTime = -2024 CanNotFindRoomMsg = -2025 ObjIsMaster = -2026 ObjIsManager = -2027 SetPayPwdError = -2028 CheckPayPwdError = -2029 AccountClosedByAdmin = -2030 TradeRelationshipNotExt = -2031 IsBlocked = -2032 PermissionDeny = -3000 CannotJoinGroup = -3001 NoCSPermission = -3002 NoEditGroupPermission = -3003 AlreadyJoinOutRoom = -3004 CanNotFindFriendMsg = -3005 RPError = -4000 RPEmpty = -4001 UserNotReg = -4002 UserHasReg = -4003 OnlyForNewUser = -4004 RPIdNotMatch = -4005 RPIdIllegal = -4006 VerifyCodeError = -4007 VerifyCodeExpired = -4008 RPReceived = -4009 CannotSendRP = -4010 RPTargetIllegal = -4011 ApplyAlreadyDeal = -4012 RPExpired = -4013 PaymentFailed = -4014 PraiseAmountLimited = -4015 PraiseRewardErr = -4016 GroupNotExists = -5000 UserNotEnterGroup = -5001 QueryChatLogFailed = -6000 RoomClosedByAdmin = -6001 IsRoomMemberAlready = -6100 RoomNotExists = -6101 CanNotInvite = -6102 CanNotJoinRoom = -6103 CanNotLoginOut = -6104 UserIsNotInRoom = -6105 CanNotAddFriendInRoom = -6106 UserIsNotOnline = -6107 MembersOutOfLimit = -6108 CreateRoomsOutOfLimit = -6109 MustEncryptMsgToRoom = -6110 CanNotJoinEncryptRoom = -6111 ChatLogNotFind = -6200 UserIsNotRoomMember = -6201 WSMsgFormatError = -7000 GetVerifyCodeFailed = -8000 EditRewardFailed = -8100 ShowRewardFailed = -8101 ServerInterError = -9000 NetWorkError = -9001 FunctionNotSupport = -9002 )
TODO
Variables ¶
This section is empty.
Functions ¶
func ComposeHttpAck ¶
func ComposeWsError ¶
func ParseError ¶
Types ¶
type Error ¶
type Error struct { ErrorCode int //errorCode对应错误 Message string //额外错误信息 ExtMsg string //暴露给接口,但客户端不显示 Data map[string]interface{} // contains filtered or unexported fields }
func (*Error) JustShowExtMsg ¶
func (*Error) SetChildErr ¶
服务名 + code + message
func (*Error) SetExtMessage ¶
func (*Error) WriteMessage ¶
Click to show internal directories.
Click to hide internal directories.