forked from lonng/nanoserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.go
100 lines (95 loc) · 2.82 KB
/
code.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package errutil
const (
codeBase = 1000
)
const (
Unknown = codeBase + iota
yxBadRoute
yxNotFound
yxWrongType
yxUserNameExists
yxAuthFailed
yxIllegalParameter
yxNotRSAPublicKey
yxNotRSAPrivateKey
yxIllegalLoginType
yxWrongPassword
yxUserNameNotFound
yxInitFailed
yxServerInternal
yxDbOperation
yxCacheOperation
yxPermissionDenied
yxNotImplemented
yxUserNotFound
yxTokenNotFound
yxInvalidToken
yxIllegalName
yxTokenMismatchUser
yxInvalidPlatform
yxUnsupportSignType
yxOrderNotFound
yxInvalidParameter
yxRequestFailed
yxIllegalOrderType
yxCoinNotEnough
yxFrequencyLimited
yxVerifyFailed
yxSignFailed
yxTradeExisted
yxProviderNotFound
yxThirdAccountNotFound
yxWrongThirdLoginType
yxDirNotExists
yxPayTestDisable
yxPropertyNotFound
yxUuidNotFound
yxProductionNotFound
yxRequestPrePayIDFailed
YXDeskNotFound
)
var errs = map[error]int{
YXErrBadRoute: yxBadRoute,
YXErrNotFound: yxNotFound,
YXErrWrongType: yxWrongType,
YXErrUserNameExists: yxUserNameExists,
YXErrIllegalParameter: yxIllegalParameter,
YXErrNotRSAPublicKey: yxNotRSAPublicKey,
YXErrNotRSAPrivateKey: yxNotRSAPrivateKey,
YXErrAuthFailed: yxAuthFailed,
YXErrIllegalLoginType: yxIllegalLoginType,
YXErrWrongPassword: yxWrongPassword,
YXErrUserNameNotFound: yxUserNameNotFound,
YXErrInitFailed: yxInitFailed,
YXErrServerInternal: yxServerInternal,
YXErrDBOperation: yxDbOperation,
YXErrCacheOperation: yxCacheOperation,
YXErrPermissionDenied: yxPermissionDenied,
YXErrNotImplemented: yxNotImplemented,
YXErrUserNotFound: yxUserNotFound,
YXErrTokenNotFound: yxTokenNotFound,
YXErrInvalidToken: yxInvalidToken,
YXErrIllegalName: yxIllegalName,
YXErrTokenMismatchUser: yxTokenMismatchUser,
YXErrInvalidPayPlatform: yxInvalidPlatform,
YXErrUnsupportSignType: yxUnsupportSignType,
YXErrOrderNotFound: yxOrderNotFound,
YXErrInvalidParameter: yxInvalidParameter,
YXErrRequestFailed: yxRequestFailed,
YXErrIllegalOrderType: yxIllegalOrderType,
YXErrCoinNotEnough: yxCoinNotEnough,
YXErrFrequencyLimited: yxFrequencyLimited,
YXErrVerifyFailed: yxVerifyFailed,
YXErrSignFailed: yxSignFailed,
YXErrTradeExisted: yxTradeExisted,
YXErrProviderNotFound: yxProviderNotFound,
YXErrThirdAccountNotFound: yxThirdAccountNotFound,
YXErrWrongThirdLoginType: yxWrongThirdLoginType,
YXErrDirNotExists: yxDirNotExists,
YXErrPayTestDisable: yxPayTestDisable,
YXErrPropertyNotFound: yxPropertyNotFound,
YXErrUUIDNotFound: yxUuidNotFound,
YXErrProductionNotFound: yxProductionNotFound,
YXErrRequestPrePayIDFailed: yxRequestPrePayIDFailed,
YXErrDeskNotFound: YXDeskNotFound,
}