Skip to content

Commit 68d7aee

Browse files
committed
Don't require status.details in gRPC error
1 parent bf1b4dc commit 68d7aee

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

temporalio/client.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6091,17 +6091,22 @@ def on_start(
60916091
st
60926092
for st in multiop_failure.statuses
60936093
if (
6094-
st.details
6095-
and not st.details[0].Is(
6096-
temporalio.api.failure.v1.MultiOperationExecutionAborted.DESCRIPTOR
6094+
st.code != RPCStatusCode.OK
6095+
and not (
6096+
st.details
6097+
and st.details[0].Is(
6098+
temporalio.api.failure.v1.MultiOperationExecutionAborted.DESCRIPTOR
6099+
)
60976100
)
6098-
and st.code != RPCStatusCode.OK
60996101
)
61006102
),
61016103
None,
61026104
)
61036105
if status and status.code in list(RPCStatusCode):
6104-
if status.code == RPCStatusCode.ALREADY_EXISTS:
6106+
if (
6107+
status.code == RPCStatusCode.ALREADY_EXISTS
6108+
and status.details
6109+
):
61056110
details = temporalio.api.errordetails.v1.WorkflowExecutionAlreadyStartedFailure()
61066111
if status.details[0].Unpack(details):
61076112
err = temporalio.exceptions.WorkflowAlreadyStartedError(

0 commit comments

Comments
 (0)