Remove unneeded exception handlers
This commit is contained in:
parent
b6ac898f8f
commit
fa8c61382b
@ -863,29 +863,19 @@ class Exchange:
|
|||||||
if not self.exchange_has("fetchTrades"):
|
if not self.exchange_has("fetchTrades"):
|
||||||
# TODO: Maybe don't stop the bot ... ?
|
# TODO: Maybe don't stop the bot ... ?
|
||||||
raise OperationalException("This exchange does not suport downloading Trades.")
|
raise OperationalException("This exchange does not suport downloading Trades.")
|
||||||
try:
|
|
||||||
if self._trades_pagination == 'time':
|
|
||||||
return await self._async_get_trade_history_time(
|
|
||||||
pair=pair, since=since,
|
|
||||||
until=until or ccxt.Exchange.milliseconds())
|
|
||||||
elif self._trades_pagination == 'id':
|
|
||||||
return await self._async_get_trade_history_id(
|
|
||||||
pair=pair, since=since,
|
|
||||||
until=until or ccxt.Exchange.milliseconds(), from_id=from_id
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
raise OperationalException(f"Exchange {self.name} does use neither time, "
|
|
||||||
f"nor id based pagination")
|
|
||||||
|
|
||||||
except ccxt.NotSupported as e:
|
if self._trades_pagination == 'time':
|
||||||
raise OperationalException(
|
return await self._async_get_trade_history_time(
|
||||||
f'Exchange {self._api.name} does not support fetching historical trade data.'
|
pair=pair, since=since,
|
||||||
f'Message: {e}') from e
|
until=until or ccxt.Exchange.milliseconds())
|
||||||
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
elif self._trades_pagination == 'id':
|
||||||
raise TemporaryError(f'Could not load trade history due to {e.__class__.__name__}. '
|
return await self._async_get_trade_history_id(
|
||||||
f'Message: {e}') from e
|
pair=pair, since=since,
|
||||||
except ccxt.BaseError as e:
|
until=until or ccxt.Exchange.milliseconds(), from_id=from_id
|
||||||
raise OperationalException(f'Could not fetch trade data. Msg: {e}') from e
|
)
|
||||||
|
else:
|
||||||
|
raise OperationalException(f"Exchange {self.name} does use neither time, "
|
||||||
|
f"nor id based pagination")
|
||||||
|
|
||||||
def get_historic_trades(self, pair: str,
|
def get_historic_trades(self, pair: str,
|
||||||
since: Optional[int] = None,
|
since: Optional[int] = None,
|
||||||
|
Loading…
Reference in New Issue
Block a user