Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dapr/ext/workflow/dapr_workflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_workflow_state(
state = self.__obj.get_orchestration_state(instance_id, fetch_payloads=fetch_payloads)
return WorkflowState(state) if state else None
except RpcError as error:
if 'no such instance exists' in error.details():
if error.details() and 'no such instance exists' in error.details():
self._logger.warning(f'Workflow instance not found: {instance_id}')
return None
self._logger.error(
Expand Down
6 changes: 6 additions & 0 deletions tests/ext/workflow/test_workflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def get_orchestration_state(self, instance_id, fetch_payloads):
return self._inner_get_orchestration_state(
instance_id, client.OrchestrationStatus.PENDING
)
elif wf_status == 'no-details':
raise SimulatedRpcError(code='UNAVAILABLE', details=None)
else:
raise SimulatedRpcError(code='UNKNOWN', details='unknown error')

Expand Down Expand Up @@ -250,6 +252,10 @@ def test_client_functions(self):

assert actual_get_result is None

wf_status = 'no-details'
with self.assertRaises(RpcError):
wfClient.get_workflow_state(instance_id=mock_instance_id, fetch_payloads=True)

wf_status = 'found'
actual_get_result = wfClient.get_workflow_state(
instance_id=mock_instance_id, fetch_payloads=True
Expand Down