@@ -48,7 +48,6 @@ use temporalio_macros::{activities, workflow, workflow_methods};
4848use temporalio_sdk:: {
4949 ActivityExecutionError , ActivityOptions , ApplicationFailure , CancellableFuture ,
5050 LocalActivityOptions , WorkflowContext , WorkflowContextView , WorkflowResult ,
51- WorkflowTermination ,
5251 activities:: { ActivityContext , ActivityError } ,
5352 interceptors:: { FailOnNondeterminismInterceptor , WorkerInterceptor } ,
5453} ;
@@ -81,8 +80,7 @@ impl OneLocalActivityWf {
8180 "hi!" . to_string ( ) ,
8281 LocalActivityOptions :: default ( ) ,
8382 )
84- . await
85- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
83+ . await ?;
8684 assert ! ( initial_workflow_time < ctx. workflow_time( ) . unwrap( ) ) ;
8785 Ok ( ( ) )
8886 }
@@ -1128,8 +1126,7 @@ async fn long_local_activity_with_update(
11281126 Duration :: from_secs ( 6 ) ,
11291127 LocalActivityOptions :: default ( ) ,
11301128 )
1131- . await
1132- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
1129+ . await ?;
11331130 Ok ( ctx. state ( |wf| wf. update_counter ) )
11341131 }
11351132
@@ -1273,8 +1270,7 @@ impl LocalActivityWithSummaryWf {
12731270 ..Default :: default ( )
12741271 } ,
12751272 )
1276- . await
1277- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
1273+ . await ?;
12781274 Ok ( ( ) )
12791275 }
12801276}
@@ -1440,8 +1436,7 @@ async fn local_act_heartbeat(#[case] shutdown_middle: bool) {
14401436 "hi" . to_string ( ) ,
14411437 LocalActivityOptions :: default ( ) ,
14421438 )
1443- . await
1444- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
1439+ . await ?;
14451440 Ok ( ( ) )
14461441 }
14471442 }
@@ -1662,8 +1657,7 @@ async fn local_act_null_result() {
16621657 #[ run( name = DEFAULT_WORKFLOW_TYPE ) ]
16631658 async fn run ( ctx : & mut WorkflowContext < Self > ) -> WorkflowResult < ( ) > {
16641659 ctx. start_local_activity ( StdActivities :: default, ( ) , LocalActivityOptions :: default ( ) )
1665- . await
1666- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
1660+ . await ?;
16671661 Ok ( ( ) )
16681662 }
16691663 }
@@ -1699,8 +1693,7 @@ async fn local_act_command_immediately_follows_la_marker() {
16991693 #[ run( name = DEFAULT_WORKFLOW_TYPE ) ]
17001694 async fn run ( ctx : & mut WorkflowContext < Self > ) -> WorkflowResult < ( ) > {
17011695 ctx. start_local_activity ( StdActivities :: default, ( ) , LocalActivityOptions :: default ( ) )
1702- . await
1703- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
1696+ . await ?;
17041697 ctx. timer ( Duration :: from_secs ( 1 ) ) . await ;
17051698 Ok ( ( ) )
17061699 }
@@ -2319,8 +2312,7 @@ async fn resolved_las_not_recorded_if_wft_fails_many_times() {
23192312 ..Default :: default ( )
23202313 } ,
23212314 )
2322- . await
2323- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
2315+ . await ?;
23242316 panic ! ( )
23252317 }
23262318 }
@@ -2870,11 +2862,9 @@ impl TwoLaWf {
28702862 #[ run( name = DEFAULT_WORKFLOW_TYPE ) ]
28712863 async fn run ( ctx : & mut WorkflowContext < Self > ) -> WorkflowResult < ( ) > {
28722864 ctx. start_local_activity ( StdActivities :: default, ( ) , LocalActivityOptions :: default ( ) )
2873- . await
2874- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
2865+ . await ?;
28752866 ctx. start_local_activity ( StdActivities :: default, ( ) , LocalActivityOptions :: default ( ) )
2876- . await
2877- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
2867+ . await ?;
28782868 Ok ( ( ) )
28792869 }
28802870}
@@ -3007,12 +2997,10 @@ impl LaTimerLaWf {
30072997 #[ run( name = DEFAULT_WORKFLOW_TYPE ) ]
30082998 async fn run ( ctx : & mut WorkflowContext < Self > ) -> WorkflowResult < ( ) > {
30092999 ctx. start_local_activity ( StdActivities :: default, ( ) , LocalActivityOptions :: default ( ) )
3010- . await
3011- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
3000+ . await ?;
30123001 ctx. timer ( Duration :: from_secs ( 5 ) ) . await ;
30133002 ctx. start_local_activity ( StdActivities :: default, ( ) , LocalActivityOptions :: default ( ) )
3014- . await
3015- . map_err ( |e| WorkflowTermination :: from ( anyhow:: Error :: from ( e) ) ) ?;
3003+ . await ?;
30163004 Ok ( ( ) )
30173005 }
30183006}
0 commit comments