Skip to content

Commit 5a06a6a

Browse files
committed
Don't require status.details in gRPC error
1 parent 7251fdf commit 5a06a6a

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
@@ -6098,17 +6098,22 @@ def on_start(
60986098
st
60996099
for st in multiop_failure.statuses
61006100
if (
6101-
st.details
6102-
and not st.details[0].Is(
6103-
temporalio.api.failure.v1.MultiOperationExecutionAborted.DESCRIPTOR
6101+
st.code != RPCStatusCode.OK
6102+
and not (
6103+
st.details
6104+
and st.details[0].Is(
6105+
temporalio.api.failure.v1.MultiOperationExecutionAborted.DESCRIPTOR
6106+
)
61046107
)
6105-
and st.code != RPCStatusCode.OK
61066108
)
61076109
),
61086110
None,
61096111
)
61106112
if status and status.code in list(RPCStatusCode):
6111-
if status.code == RPCStatusCode.ALREADY_EXISTS:
6113+
if (
6114+
status.code == RPCStatusCode.ALREADY_EXISTS
6115+
and status.details
6116+
):
61126117
details = temporalio.api.errordetails.v1.WorkflowExecutionAlreadyStartedFailure()
61136118
if status.details[0].Unpack(details):
61146119
err = temporalio.exceptions.WorkflowAlreadyStartedError(

0 commit comments

Comments
 (0)