mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-09 18:18:43 +08:00
BUG: fixed issue #176 with ignoring ticker errors instead of raising
This commit is contained in:
@@ -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'])
|
||||
|
||||
|
||||
@@ -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
|
||||
-------
|
||||
|
||||
Reference in New Issue
Block a user