Improve logging for sell exception

This commit is contained in:
Matthias 2020-08-02 10:12:15 +02:00
parent 071e82043a
commit 99bfa839eb
2 changed files with 3 additions and 2 deletions

View File

@ -660,7 +660,7 @@ class FreqtradeBot:
trades_closed += 1
except DependencyException as exception:
logger.warning('Unable to sell trade: %s', exception)
logger.warning('Unable to sell trade %s: %s', trade.pair, exception)
# Updating wallets if any trade occured
if trades_closed:

View File

@ -1660,6 +1660,7 @@ def test_exit_positions_exception(mocker, default_conf, limit_buy_order, caplog)
trade = MagicMock()
trade.open_order_id = None
trade.open_fee = 0.001
trade.pair = 'ETH/BTC'
trades = [trade]
# Test raise of DependencyException exception
@ -1669,7 +1670,7 @@ def test_exit_positions_exception(mocker, default_conf, limit_buy_order, caplog)
)
n = freqtrade.exit_positions(trades)
assert n == 0
assert log_has('Unable to sell trade: ', caplog)
assert log_has('Unable to sell trade ETH/BTC: ', caplog)
def test_update_trade_state(mocker, default_conf, limit_buy_order, caplog) -> None: