Skip to content

Commit

Permalink
Actually ignore errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Jul 31, 2024
1 parent ec7298a commit 0dab465
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions api/src/opentrons/protocol_engine/clients/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ async def run_in_pe_thread() -> Command:
)

if command.error is not None:
error_was_recovered_from = (
error_recovery_type = (
self._engine.state_view.commands.get_error_recovery_type(command.id)
== ErrorRecoveryType.WAIT_FOR_RECOVERY
)
if not error_was_recovered_from:
error_should_fail_run = (
error_recovery_type == ErrorRecoveryType.FAIL_RUN
)
if error_should_fail_run:
error = command.error
# TODO: this needs to have an actual code
raise ProtocolCommandFailedError(
Expand Down
8 changes: 5 additions & 3 deletions api/src/opentrons/protocol_runner/protocol_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,15 @@ async def _add_and_execute_commands(self) -> None:
)
)
if executed_command.error is not None:
error_was_recovered_from = (
error_recovery_type = (
self._protocol_engine.state_view.commands.get_error_recovery_type(
executed_command.id
)
== ErrorRecoveryType.WAIT_FOR_RECOVERY
)
if not error_was_recovered_from:
error_should_fail_run = (
error_recovery_type == ErrorRecoveryType.FAIL_RUN
)
if error_should_fail_run:
raise ProtocolCommandFailedError(
original_error=executed_command.error,
message=f"{executed_command.error.errorType}: {executed_command.error.detail}",
Expand Down

0 comments on commit 0dab465

Please sign in to comment.