FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-binance/binance/exceptions.py at develop · EncodingJerry/python-binance · GitHub
EncodingJerry
/
python-binance
Public
forked from
kbai/python-binance
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-binance
/
binance
/
exceptions.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
83 lines (54 loc) · 2.47 KB
Breadcrumbs
python-binance
/
binance
/
exceptions.py
Copy path
File metadata and controls
83 lines (54 loc) · 2.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# coding=utf-8
class
BinanceAPIException
(
Exception
):
def
__init__
(
self
,
response
):
self
.
code
=
0
try
:
json_res
=
response
.
json
()
except
ValueError
:
self
.
message
=
'Invalid JSON error message from Binance: {}'
.
format
(
response
.
text
)
else
:
self
.
code
=
json_res
[
'code'
]
self
.
message
=
json_res
[
'msg'
]
self
.
status_code
=
response
.
status_code
self
.
response
=
response
self
.
request
=
getattr
(
response
,
'request'
,
None
)
def
__str__
(
self
):
# pragma: no cover
return
'APIError(code=%s): %s'
%
(
self
.
code
,
self
.
message
)
class
BinanceRequestException
(
Exception
):
def
__init__
(
self
,
message
):
self
.
message
=
message
def
__str__
(
self
):
return
'BinanceRequestException: %s'
%
self
.
message
class
BinanceOrderException
(
Exception
):
def
__init__
(
self
,
code
,
message
):
self
.
code
=
code
self
.
message
=
message
def
__str__
(
self
):
return
'BinanceOrderException(code=%s): %s'
%
(
self
.
code
,
self
.
message
)
class
BinanceOrderMinAmountException
(
BinanceOrderException
):
def
__init__
(
self
,
value
):
message
=
"Amount must be a multiple of %s"
%
value
super
(
BinanceOrderMinAmountException
,
self
).
__init__
(
-
1013
,
message
)
class
BinanceOrderMinPriceException
(
BinanceOrderException
):
def
__init__
(
self
,
value
):
message
=
"Price must be at least %s"
%
value
super
(
BinanceOrderMinPriceException
,
self
).
__init__
(
-
1013
,
message
)
class
BinanceOrderMinTotalException
(
BinanceOrderException
):
def
__init__
(
self
,
value
):
message
=
"Total must be at least %s"
%
value
super
(
BinanceOrderMinTotalException
,
self
).
__init__
(
-
1013
,
message
)
class
BinanceOrderUnknownSymbolException
(
BinanceOrderException
):
def
__init__
(
self
,
value
):
message
=
"Unknown symbol %s"
%
value
super
(
BinanceOrderUnknownSymbolException
,
self
).
__init__
(
-
1013
,
message
)
class
BinanceOrderInactiveSymbolException
(
BinanceOrderException
):
def
__init__
(
self
,
value
):
message
=
"Attempting to trade an inactive symbol %s"
%
value
super
(
BinanceOrderInactiveSymbolException
,
self
).
__init__
(
-
1013
,
message
)
class
BinanceWithdrawException
(
Exception
):
def
__init__
(
self
,
message
):
if
message
==
u'参数异常'
:
message
=
'Withdraw to this address through the website first'
self
.
message
=
message
def
__str__
(
self
):
return
'BinanceWithdrawException: %s'
%
self
.
message
Back
|
FazBrowse Home
|
New Git URL