Skip to content

Commit

Permalink
Change to self explanatory function name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aeshub committed Dec 2, 2024
1 parent 8e7287a commit 954a75b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/isar/state_machine/states/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 954a75b

Please sign in to comment.