@@ -16,6 +16,7 @@ namespace Microsoft.Azure.Functions.PowerShellWorker.Durable
1616 internal class OrchestrationInvoker : IOrchestrationInvoker
1717 {
1818 private IExternalInvoker _externalInvoker ;
19+ internal static string isOrchestrationFailureKey = "IsOrchestrationFailure" ;
1920
2021 public Hashtable Invoke (
2122 OrchestrationBindingInfo orchestrationBindingInfo ,
@@ -25,32 +26,24 @@ public Hashtable Invoke(
2526 {
2627 if ( powerShellServices . UseExternalDurableSDK ( ) )
2728 {
28- return InvokeExternalDurableSDK ( orchestrationBindingInfo , powerShellServices ) ;
29+ return InvokeExternalDurableSDK ( powerShellServices ) ;
2930 }
3031 return InvokeInternalDurableSDK ( orchestrationBindingInfo , powerShellServices ) ;
3132 }
33+ catch ( Exception ex )
34+ {
35+ ex . Data . Add ( isOrchestrationFailureKey , true ) ;
36+ throw ;
37+ }
3238 finally
3339 {
3440 powerShellServices . ClearStreamsAndCommands ( ) ;
3541 }
3642 }
3743
38- public Hashtable InvokeExternalDurableSDK (
39- OrchestrationBindingInfo orchestrationBindingInfo ,
40- IPowerShellServices powerShellServices )
44+ public Hashtable InvokeExternalDurableSDK ( IPowerShellServices powerShellServices )
4145 {
42-
43- _externalInvoker . Invoke ( ) ;
44- var result = orchestrationBindingInfo . Context . ExternalSDKResult ;
45- var isError = orchestrationBindingInfo . Context . ExternalSDKIsError ;
46- if ( isError )
47- {
48- throw ( Exception ) result ;
49- }
50- else
51- {
52- return ( Hashtable ) result ;
53- }
46+ return _externalInvoker . Invoke ( powerShellServices ) ;
5447 }
5548
5649 public Hashtable InvokeInternalDurableSDK (
0 commit comments