From 771519e311170ca82de985c871a0f8f7db6870d1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 1 Sep 2019 10:17:36 +0200 Subject: [PATCH] Don't show stacktrace in case of invalidorder Error This is handled gracefully by emergency-selling --- freqtrade/freqtradebot.py | 4 ++-- freqtrade/tests/test_freqtradebot.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index ab3a1df28..7c403a29b 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -632,9 +632,9 @@ class FreqtradeBot(object): rate=rate * LIMIT_PRICE_PCT) trade.stoploss_order_id = str(stoploss_order['id']) return True - except InvalidOrderException: + except InvalidOrderException as e: trade.stoploss_order_id = None - logger.exception('Unable to place a stoploss order on exchange.') + logger.error(f'Unable to place a stoploss order on exchange. {e}') logger.warning('Selling the trade forcefully') self.execute_sell(trade, trade.stop_loss, sell_reason=SellType.EMERGENCY_SELL) diff --git a/freqtrade/tests/test_freqtradebot.py b/freqtrade/tests/test_freqtradebot.py index e4e5104d0..af69600b8 100644 --- a/freqtrade/tests/test_freqtradebot.py +++ b/freqtrade/tests/test_freqtradebot.py @@ -1230,7 +1230,7 @@ def test_create_stoploss_order_invalid_order(mocker, default_conf, caplog, fee, freqtrade.create_stoploss_order(trade, 200, 199) assert trade.stoploss_order_id is None assert trade.sell_reason == SellType.EMERGENCY_SELL.value - assert log_has("Unable to place a stoploss order on exchange.", caplog) + assert log_has("Unable to place a stoploss order on exchange. ", caplog) assert log_has("Selling the trade forcefully", caplog) # Should call a market sell