added exception handlers to fetch_market_leverage_tiers
This commit is contained in:
parent
421aa31c92
commit
c7e87e86e2
@ -1905,8 +1905,18 @@ class Exchange:
|
|||||||
"This will take about a minute.")
|
"This will take about a minute.")
|
||||||
|
|
||||||
for symbol in sorted(symbols):
|
for symbol in sorted(symbols):
|
||||||
res = self._api.fetch_market_leverage_tiers(symbol)
|
try:
|
||||||
tiers[symbol] = res[symbol]
|
res = self._api.fetch_market_leverage_tiers(symbol)
|
||||||
|
tiers[symbol] = res[symbol]
|
||||||
|
except ccxt.DDoSProtection as e:
|
||||||
|
raise DDosProtection(e) from e
|
||||||
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
||||||
|
raise TemporaryError(
|
||||||
|
f'Could not load leverage tiers for {symbol}'
|
||||||
|
f' due to {e.__class__.__name__}. Message: {e}'
|
||||||
|
) from e
|
||||||
|
except ccxt.BaseError as e:
|
||||||
|
raise OperationalException(e) from e
|
||||||
logger.info(f"Done initializing {len(symbols)} markets.")
|
logger.info(f"Done initializing {len(symbols)} markets.")
|
||||||
|
|
||||||
return tiers
|
return tiers
|
||||||
|
Loading…
Reference in New Issue
Block a user