Skip to content

Commit

Permalink
2.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
DogsTailFarmer committed Apr 3, 2024
1 parent 77f0b39 commit 1025a1f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.7 2024-03-29
### Fix
* `Bybit`: http error handling: handling events that are not explicitly described

## 2.1.6 2024-03-29
### Fix
* Bybit: `on_balance_update`: missed event during transfer from API
Expand Down
2 changes: 1 addition & 1 deletion exchanges_wrapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__contact__ = "https://github.com/DogsTailFarmer"
__email__ = "[email protected]"
__credits__ = ["https://github.com/DanyaSWorlD"]
__version__ = "2.1.6"
__version__ = "2.1.7"

from pathlib import Path
import shutil
Expand Down
6 changes: 4 additions & 2 deletions exchanges_wrapper/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ async def handle_errors(self, response):
return payload.get('result'), payload.get('time')
elif payload.get('retCode') == 10002:
raise ExchangeError(ERR_TIMESTAMP_OUTSIDE_RECV_WINDOW)
else:
raise ExchangeError(f"API request failed: {response.status}:{response.reason}:{payload}")
elif self.exchange == 'huobi' and payload and (payload.get('status') == 'ok' or payload.get('ok')):
return payload.get('data', payload.get('tick'))
elif self.exchange == 'okx' and payload and payload.get('code') == '0':
return payload.get('data', [])
elif (self.exchange not in ('binance', 'bitfinex') or
(self.exchange == 'binance' and payload and "code" in payload)):
elif self.exchange not in ('binance', 'bitfinex') \
or (self.exchange == 'binance' and payload and "code" in payload):
raise ExchangeError(f"API request failed: {response.status}:{response.reason}:{payload}")
else:
return payload
Expand Down

0 comments on commit 1025a1f

Please sign in to comment.