Show potential errors when loading markets
This commit is contained in:
parent
16a54b3616
commit
73876b61b4
@ -311,8 +311,8 @@ class Exchange:
|
|||||||
self._markets = self._api.load_markets()
|
self._markets = self._api.load_markets()
|
||||||
self._load_async_markets()
|
self._load_async_markets()
|
||||||
self._last_markets_refresh = arrow.utcnow().int_timestamp
|
self._last_markets_refresh = arrow.utcnow().int_timestamp
|
||||||
except ccxt.BaseError as e:
|
except ccxt.BaseError:
|
||||||
logger.warning('Unable to initialize markets. Reason: %s', e)
|
logger.exception('Unable to initialize markets.')
|
||||||
|
|
||||||
def reload_markets(self) -> None:
|
def reload_markets(self) -> None:
|
||||||
"""Reload markets both sync and async if refresh interval has passed """
|
"""Reload markets both sync and async if refresh interval has passed """
|
||||||
|
@ -498,7 +498,7 @@ def test__load_markets(default_conf, mocker, caplog):
|
|||||||
mocker.patch('freqtrade.exchange.Exchange._load_async_markets')
|
mocker.patch('freqtrade.exchange.Exchange._load_async_markets')
|
||||||
mocker.patch('freqtrade.exchange.Exchange.validate_stakecurrency')
|
mocker.patch('freqtrade.exchange.Exchange.validate_stakecurrency')
|
||||||
Exchange(default_conf)
|
Exchange(default_conf)
|
||||||
assert log_has('Unable to initialize markets. Reason: SomeError', caplog)
|
assert log_has('Unable to initialize markets.', caplog)
|
||||||
|
|
||||||
expected_return = {'ETH/BTC': 'available'}
|
expected_return = {'ETH/BTC': 'available'}
|
||||||
api_mock = MagicMock()
|
api_mock = MagicMock()
|
||||||
|
Loading…
Reference in New Issue
Block a user