You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "index.py", line 144, in <module>
bfbot.main()
File "index.py", line 132, in main
self.buyBtc()
File "index.py", line 77, in buyBtc
time_in_force = "GTC"
File "/Users/XXXXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pybitflyer/pybitflyer.py", line 481, in sendchildorder
return self.request(endpoint, "POST", params=params)
File "/Users/XXXXXX/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pybitflyer/pybitflyer.py", line 60, in request
content = json.loads(response.content.decode("utf-8"))
File "/Users/XXXXXX/.pyenv/versions/3.6.0/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/Users/XXXXXX/.pyenv/versions/3.6.0/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/XXXXXX/.pyenv/versions/3.6.0/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered:
bitFlyer did not guarantee that your request will be accepted, even everything is fine.
In your case, I guess its because bitFlyer didnt respond anything to your new order.
It is not a problem of this lib, although it would be nicer to catch these exception inside this lib.
However, it will be a problem of design,
that how much should you expect from this lib.
I think this lib should be used as a pure wrapper of native API,
you should handle above exception in your code.
But again, it will be nicer if we have that response.content in return.
You must check any operation that is out of your control.
You send order and bitFlyer accept it, in this process, you dont know how bitFlyer will respond,
you can only EXPECT their response.
Hence, you must check it.
That is an error response from Cloudflare(CDN of API server). When bitflyer's API server is down, API returns that response.
If you want to detect the timeout error more quickly, specify the timeout option.
api = pybitflyer.API(timeout=30)
requests.exceptions.ConnectTimeout or requests.exceptions.ReadTimeout will be raise if there is no response from API server for 30 seconds.
便利なライブラリーのご提供ありがとうございます。
ごくたまになのですが注文sendchildorderをすると以下のようなエラーを吐いてしまいます。
もしよろしければご確認よろしくお願いいたします。
The text was updated successfully, but these errors were encountered: