From 4c30bf5d0fb833762cffb0bace7add9b01236004 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Fri, 17 May 2024 17:26:41 -0400 Subject: [PATCH] fix estop handling --- api/src/opentrons/protocol_engine/state/commands.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/src/opentrons/protocol_engine/state/commands.py b/api/src/opentrons/protocol_engine/state/commands.py index bd171d88cfd..0c055fdee39 100644 --- a/api/src/opentrons/protocol_engine/state/commands.py +++ b/api/src/opentrons/protocol_engine/state/commands.py @@ -390,6 +390,15 @@ def handle_action(self, action: Action) -> None: # noqa: C901 action.error_details.created_at, action.error_details.error, ) + else: + # HACK(sf): There needs to be a better way to set + # an estop error than this else clause + if self._state.stopped_by_estop and action.error_details: + self._state.run_error = self._map_run_exception_to_error_occurrence( + action.error_details.error_id, + action.error_details.created_at, + action.error_details.error, + ) elif isinstance(action, HardwareStoppedAction): self._state.queue_status = QueueStatus.PAUSED