From 50ad5486e8967c235e60db318f6c130d9f7f480c Mon Sep 17 00:00:00 2001 From: Christoph Langer Date: Tue, 5 Nov 2024 12:27:37 +0100 Subject: [PATCH] Re-subscribe in case of an error from Trade Republic (#133) Thanks for the fix --- pytr/dl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pytr/dl.py b/pytr/dl.py index 28faca3..c51341d 100644 --- a/pytr/dl.py +++ b/pytr/dl.py @@ -71,7 +71,9 @@ async def dl_loop(self): try: _, subscription, response = await self.tr.recv() except TradeRepublicError as e: - self.log.fatal(str(e)) + self.log.error(f"Error response for subscription \"{e.subscription}\". Re-subscribing...") + await self.tr.subscribe(e.subscription) + continue if subscription.get("type", "") == "timelineTransactions": await self.tl.get_next_timeline_transactions(response)