BUG: fixed issue #176 with ignoring ticker errors instead of raising

This commit is contained in:
Frederic Fortier
2018-01-24 22:26:20 -05:00
parent f34a66e9c6
commit c09f53449a
2 changed files with 9 additions and 3 deletions
+6 -2
View File
@@ -984,7 +984,7 @@ class CCXT(Exchange):
)
raise ExchangeRequestError(error=e)
def tickers(self, assets):
def tickers(self, assets, on_ticker_error='raise'):
"""
Retrieve current tick data for the given assets
@@ -1016,7 +1016,11 @@ class CCXT(Exchange):
self.name, asset.symbol, e
)
)
continue
if on_ticker_error == 'warn':
continue
else:
raise ExchangeRequestError(error=e)
ticker['last_traded'] = from_ms_timestamp(ticker['timestamp'])
+3 -1
View File
@@ -972,13 +972,15 @@ class Exchange:
pass
@abc.abstractmethod
def tickers(self, assets):
def tickers(self, assets, on_ticker_error='raise'):
"""
Retrieve current tick data for the given assets
Parameters
----------
assets: list[TradingPair]
on_ticker_error: str [raise|warn]
How to handle an error when retrieving a single ticker.
Returns
-------