From c7e87e86e2acaf3c45907a5a254284392cfa7c5a Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Thu, 24 Feb 2022 15:30:23 -0600 Subject: [PATCH] added exception handlers to fetch_market_leverage_tiers --- freqtrade/exchange/exchange.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index aa529024a..a0532575c 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1905,8 +1905,18 @@ class Exchange: "This will take about a minute.") for symbol in sorted(symbols): - res = self._api.fetch_market_leverage_tiers(symbol) - tiers[symbol] = res[symbol] + try: + 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.") return tiers