Skip to content

Commit bc6230c

Browse files
committed
RTU: relocate OperationError
1 parent 9327bee commit bc6230c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

temporalio/worker/_nexus.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ async def _start_operation(
306306
"nexusrpc.handler.StartOperationResultAsync."
307307
)
308308
)
309-
except nexusrpc.handler.OperationError as err:
309+
except nexusrpc.OperationError as err:
310310
return temporalio.api.nexus.v1.StartOperationResponse(
311311
operation_error=await self._operation_error_to_proto(err),
312312
)
@@ -332,7 +332,7 @@ async def _exception_to_failure_proto(
332332

333333
async def _operation_error_to_proto(
334334
self,
335-
err: nexusrpc.handler.OperationError,
335+
err: nexusrpc.OperationError,
336336
) -> temporalio.api.nexus.v1.UnsuccessfulOperationError:
337337
cause = err.__cause__
338338
if cause is None:

tests/nexus/test_handler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727
import httpx
2828
import nexusrpc
2929
import pytest
30-
from nexusrpc import OperationInfo
30+
from nexusrpc import OperationError, OperationErrorState, OperationInfo
3131
from nexusrpc.handler import (
3232
CancelOperationContext,
3333
FetchOperationInfoContext,
3434
FetchOperationResultContext,
3535
HandlerError,
3636
HandlerErrorType,
37-
OperationError,
38-
OperationErrorState,
3937
OperationHandler,
4038
StartOperationContext,
4139
service_handler,

0 commit comments

Comments
 (0)