From 29fbac9f9698934a3fd2693be51b3e0da73e3627 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 10 Sep 2023 20:27:08 +0200 Subject: [PATCH] Add "catch-all" exceptionhandler for handle_onexchange_order (it's actually a poor mans workaround) closes #9025 --- freqtrade/freqtradebot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index f66fe8feb..1a24009b3 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -468,8 +468,6 @@ class FreqtradeBot(LoggingMixin): safe_value_fallback(order, 'lastTradeTimestamp', 'timestamp') // 1000, tz=timezone.utc) trade.orders.append(order_obj) - # TODO: how do we handle open_order_id ... - Trade.commit() prev_exit_reason = trade.exit_reason trade.exit_reason = ExitType.SOLD_ON_EXCHANGE.value self.update_trade_state(trade, order['id'], order) @@ -485,7 +483,10 @@ class FreqtradeBot(LoggingMixin): Trade.commit() except ExchangeError: - logger.warning("Error finding onexchange order") + logger.warning("Error finding onexchange order.") + except Exception: + # catching https://github.com/freqtrade/freqtrade/issues/9025 + logger.warning("Error finding onexchange order", exc_info=True) # # BUY / enter positions / open trades logic and methods #