Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-kulkarni committed Jul 3, 2024
1 parent 8ea76ee commit 6ccfc78
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions api/src/opentrons/protocol_engine/clients/sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,15 @@ def execute_command_with_result(
"""
CreateType = CREATE_TYPES_BY_PARAMS_TYPE[type(params)]
create_request = CreateType(params=cast(Any, params))
try:
result = self._transport.execute_command_wait_for_recovery(create_request)
if result.error is None:
return result.result
if isinstance(result.error, BaseException): # necessary to pass lint
raise result.error
raise ProtocolCommandFailedError(
original_error=result.error,
message=f"{result.error.errorType}: {result.error.detail}",
)
except (ProtocolCommandFailedError, RunStoppedBeforeCommandError) as e:
raise e
result = self._transport.execute_command_wait_for_recovery(create_request)
if result.error is None:
return result.result
if isinstance(result.error, BaseException): # necessary to pass lint
raise result.error
raise ProtocolCommandFailedError(
original_error=result.error,
message=f"{result.error.errorType}: {result.error.detail}",
)

@property
def state(self) -> StateView:
Expand Down

0 comments on commit 6ccfc78

Please sign in to comment.