Skip to content

Commit 0dab465

Browse files
Actually ignore errors.
1 parent ec7298a commit 0dab465

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

api/src/opentrons/protocol_engine/clients/transports.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,13 @@ async def run_in_pe_thread() -> Command:
125125
)
126126

127127
if command.error is not None:
128-
error_was_recovered_from = (
128+
error_recovery_type = (
129129
self._engine.state_view.commands.get_error_recovery_type(command.id)
130-
== ErrorRecoveryType.WAIT_FOR_RECOVERY
131130
)
132-
if not error_was_recovered_from:
131+
error_should_fail_run = (
132+
error_recovery_type == ErrorRecoveryType.FAIL_RUN
133+
)
134+
if error_should_fail_run:
133135
error = command.error
134136
# TODO: this needs to have an actual code
135137
raise ProtocolCommandFailedError(

api/src/opentrons/protocol_runner/protocol_runner.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,15 @@ async def _add_and_execute_commands(self) -> None:
391391
)
392392
)
393393
if executed_command.error is not None:
394-
error_was_recovered_from = (
394+
error_recovery_type = (
395395
self._protocol_engine.state_view.commands.get_error_recovery_type(
396396
executed_command.id
397397
)
398-
== ErrorRecoveryType.WAIT_FOR_RECOVERY
399398
)
400-
if not error_was_recovered_from:
399+
error_should_fail_run = (
400+
error_recovery_type == ErrorRecoveryType.FAIL_RUN
401+
)
402+
if error_should_fail_run:
401403
raise ProtocolCommandFailedError(
402404
original_error=executed_command.error,
403405
message=f"{executed_command.error.errorType}: {executed_command.error.detail}",

0 commit comments

Comments
 (0)