Skip to content

Commit dec0a60

Browse files
committed
Handle OperationError consistently with HandlerError
1 parent 4a36d33 commit dec0a60

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

temporalio/worker/_nexus.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,9 @@ async def _operation_error_to_proto(
337337
self,
338338
err: nexusrpc.OperationError,
339339
) -> temporalio.api.nexus.v1.UnsuccessfulOperationError:
340-
# TODO(nexus-prerelease): why are we accessing __cause__ here for OperationError
341-
# and not for HandlerError?
342-
cause = err.__cause__
343-
if cause is None:
344-
cause = Exception(*err.args).with_traceback(err.__traceback__)
345340
return temporalio.api.nexus.v1.UnsuccessfulOperationError(
346341
operation_state=err.state.value,
347-
failure=await self._exception_to_failure_proto(cause),
342+
failure=await self._exception_to_failure_proto(err),
348343
)
349344

350345
async def _handler_error_to_proto(

0 commit comments

Comments
 (0)