Skip to content

Commit 121dd4f

Browse files
Add comment to error handling
1 parent ebbf89b commit 121dd4f

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/isar/robot/robot_pause_mission.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def robot_pause_mission(
4242
continue
4343
return None
4444

45+
# error is always set when the loop exits without returning — every iteration
46+
# either returns early or assigns error before continuing
4547
assert error is not None
4648
error_description = (
4749
f"\nFailed to pause the robot after {retries} attempts because: "

src/isar/robot/robot_resume_mission.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def robot_resume_mission(
4545
retries += 1
4646
continue
4747

48+
# error is always set when the loop exits without returning — every iteration
49+
# either returns early or assigns error before continuing
4850
assert error is not None
4951
error_description = (
5052
f"\nFailed to resume the robot after {retries + 1} attempts because: "

src/isar/robot/robot_stop_mission.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def robot_stop_mission(
4343
continue
4444
return None
4545

46+
# error is always set when the loop exits without returning — every iteration
47+
# either returns early or assigns error before continuing
4648
assert error is not None
4749
error_description = (
4850
f"\nFailed to stop the robot after {retries} attempts because: "

0 commit comments

Comments
 (0)