-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.go
44 lines (41 loc) · 1.21 KB
/
data.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
package errs
const (
CodeNetFail = -1*iota - 1
CodeNotSupport
CodeInvalidRequest
CodeAccKeyError
CodeMissingApiKey
CodeCredsRequired
CodeSignFail
CodeRunTime
CodeNotImplement
CodeMarketNotLoad
CodeNoMarketForPair
CodeUnsupportMarket
CodeSandboxApiNotSupport
CodeApiNotSupport
CodeInvalidResponse
CodeUnmarshalFail
CodeParamRequired
CodeParamInvalid
CodeWsInvalidMsg
CodeWsReadFail
CodeConnectFail
CodeInvalidTimeFrame
CodePrecDecFail
CodeBadExgName
)
var (
MissingApiKey = NewMsg(CodeMissingApiKey, "ApiKey missing")
CredsRequired = NewMsg(CodeCredsRequired, "credential fields missing")
ApiNotSupport = NewMsg(CodeApiNotSupport, "api not support")
SandboxApiNotSupport = NewMsg(CodeSandboxApiNotSupport, "sandbox api not support")
UnsupportMarket = NewMsg(CodeUnsupportMarket, "unsupported market type")
NoMarketForPair = NewMsg(CodeNoMarketForPair, "no market found for pair")
MarketNotLoad = NewMsg(CodeMarketNotLoad, "markets not loaded")
NotImplement = NewMsg(CodeNotImplement, "method not implement")
InvalidTimeFrame = NewMsg(CodeInvalidTimeFrame, "invalid timeframe")
)
var (
PrintErr func(e error) string // print string for common error
)