From 954a75bf5f49528569cdc037f860a3ab0654cd99 Mon Sep 17 00:00:00 2001 From: aestene Date: Mon, 2 Dec 2024 11:17:46 +0100 Subject: [PATCH] Change to self explanatory function name The old name did not indicate what the return boolean meant. The new name, combined with new variable name, should make the code more readable. --- src/isar/state_machine/states/monitor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/isar/state_machine/states/monitor.py b/src/isar/state_machine/states/monitor.py index a7d8b1fe..e92bc76e 100644 --- a/src/isar/state_machine/states/monitor.py +++ b/src/isar/state_machine/states/monitor.py @@ -80,8 +80,8 @@ def _run(self) -> None: RobotCommunicationTimeoutException, RobotCommunicationException, ) as e: - task_failed: bool = self._handle_communication_retry(e) - if task_failed: + retry_limit_exceeded: bool = self._check_if_exceeded_retry_limit(e) + if retry_limit_exceeded: self.logger.error( f"Monitoring task {self.state_machine.current_task.id[:8]} failed " f"because: {e.error_description}" @@ -219,7 +219,7 @@ def _set_error_message(self, e: RobotException) -> None: ) self.state_machine.current_task.error_message = error_message - def _handle_communication_retry( + def _check_if_exceeded_retry_limit( self, e: Union[RobotCommunicationTimeoutException, RobotCommunicationException] ) -> bool: self.state_machine.current_mission.error_message = ErrorMessage(