@@ -40,7 +40,7 @@ public Hashtable Invoke(OrchestrationBindingInfo orchestrationBindingInfo, IPowe
4040 {
4141 // The orchestration function should be stopped and restarted
4242 pwsh . StopInvoke ( ) ;
43- return CreateOrchestrationResult ( isDone : false , actions , output : null ) ;
43+ return CreateOrchestrationResult ( isDone : false , actions , output : null , context . CustomStatus ) ;
4444 }
4545 else
4646 {
@@ -49,13 +49,13 @@ public Hashtable Invoke(OrchestrationBindingInfo orchestrationBindingInfo, IPowe
4949 // The orchestration function completed
5050 pwsh . EndInvoke ( asyncResult ) ;
5151 var result = FunctionReturnValueBuilder . CreateReturnValueFromFunctionOutput ( outputBuffer ) ;
52- return CreateOrchestrationResult ( isDone : true , actions , output : result ) ;
52+ return CreateOrchestrationResult ( isDone : true , actions , output : result , context . CustomStatus ) ;
5353 }
5454 catch ( Exception e )
5555 {
5656 // The orchestrator code has thrown an unhandled exception:
5757 // this should be treated as an entire orchestration failure
58- throw new OrchestrationFailureException ( actions , e ) ;
58+ throw new OrchestrationFailureException ( actions , context . CustomStatus , e ) ;
5959 }
6060 }
6161 }
@@ -68,9 +68,10 @@ public Hashtable Invoke(OrchestrationBindingInfo orchestrationBindingInfo, IPowe
6868 private static Hashtable CreateOrchestrationResult (
6969 bool isDone ,
7070 List < List < OrchestrationAction > > actions ,
71- object output )
71+ object output ,
72+ object customStatus )
7273 {
73- var orchestrationMessage = new OrchestrationMessage ( isDone , actions , output ) ;
74+ var orchestrationMessage = new OrchestrationMessage ( isDone , actions , output , customStatus ) ;
7475 return new Hashtable { { AzFunctionInfo . DollarReturn , orchestrationMessage } } ;
7576 }
7677 }
0 commit comments