From d1a0cbc0444d987b0a56456597e67a66b0462255 Mon Sep 17 00:00:00 2001 From: "Mariana R. Santos" Date: Mon, 2 Dec 2024 09:22:28 +0100 Subject: [PATCH] Add logger for communication exception --- src/isar/state_machine/states/monitor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/isar/state_machine/states/monitor.py b/src/isar/state_machine/states/monitor.py index 612d089d..6eedde50 100644 --- a/src/isar/state_machine/states/monitor.py +++ b/src/isar/state_machine/states/monitor.py @@ -76,13 +76,16 @@ def _run(self) -> None: except ThreadedRequestNotFinishedError: time.sleep(self.state_machine.sleep_time) continue - except ( RobotCommunicationTimeoutException, RobotCommunicationException, ) as e: task_failed: bool = self._handle_communication_retry(e) if task_failed: + self.logger.error( + f"Monitoring task {self.state_machine.current_task.id[:8]} failed " + f"because: {e.error_description}" + ) status = TaskStatus.Failed else: continue