Exception not propagating from Activity to Orchestrator
See original GitHub issueMy desire is to put the orchestrator into a ‘Failed’ state if an Activity doesn’t successfully complete (throws an exception).
My understanding is that an uncaught exception in an Activity would be raised in the Orchestrator, however I’m not seeing this behaviour.
Infact I’ve ran the below code to try and force an exception but I still can’t get the orchestrator to fail.
Please can you advise if my expectations or code are wrong here?
Also, customStatus is not being set so I’m pretty confident that the catch block isn’t even entering.
Azure Functions v2 - DF 1.7.1
Orchestrator
[FunctionName("Orchestrator")]
public static async Task<List<string>> RunOrchestratorAsync([OrchestrationTrigger] DurableOrchestrationContextBase context)
{
.....
try
{
things = await context.CallActivityAsync<Queue<Thing>>("get_things", request);
}
catch (FunctionFailedException ex)
{
context.SetCustomStatus($"caught ex {ex.Message}");
throw new Exception("caught ex", ex);
}
catch (Exception ex)
{
context.SetCustomStatus($"caught ex {ex.Message}");
throw new Exception("caught ex", ex);
}
......
}
Activity
[FunctionName("get_things")]
public static async Task<Queue<Thing>> Run([ActivityTrigger] Request request, ILogger log)
{
throw new Exception("Forced Failure");
}
Orchestrator History
PartitionKey | RowKey | Timestamp | EventId | EventId@type | EventType | EventType@type | ExecutionId | ExecutionId@type | IsPlayed | IsPlayed@type | _Timestamp | _Timestamp@type | Input | Input@type | Name | Name@type | OrchestrationInstance | OrchestrationInstance@type | Version | Version@type | Result | Result@type | TaskScheduledId | TaskScheduledId@type | OrchestrationStatus | OrchestrationStatus@type | | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – | – bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000000 | 2019-02-14T17:27:31.020Z | -1 | Edm.Int32 | OrchestratorStarted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | false | Edm.Boolean | 2019-02-14T17:27:30.210Z | Edm.DateTime | | | | | | | | | | | | | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000001 | 2019-02-14T17:27:31.020Z | -1 | Edm.Int32 | ExecutionStarted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | true | Edm.Boolean | 2019-02-14T17:27:29.496Z | Edm.DateTime | <REDACTED> | Edm.String | Orchestrator | Edm.String | {“InstanceId”:“bb1ee432-1f9d-42a1-9401-7481c7c54c7b”,“ExecutionId”:“28a8693a972244e0b512f9fc961b54f4”} | Edm.String | | Edm.String | | | | | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000002 | 2019-02-14T17:27:31.021Z | 0 | Edm.Int32 | TaskScheduled | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | false | Edm.Boolean | 2019-02-14T17:27:30.848Z | Edm.DateTime | | | get_things | Edm.String | | | | Edm.String | | | | | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000003 | 2019-02-14T17:27:31.021Z | -1 | Edm.Int32 | OrchestratorCompleted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | false | Edm.Boolean | 2019-02-14T17:27:30.848Z | Edm.DateTime | | | | | | | | | | | | | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000004 | 2019-02-14T17:27:32.088Z | -1 | Edm.Int32 | OrchestratorStarted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | false | Edm.Boolean | 2019-02-14T17:27:31.981Z | Edm.DateTime | | | | | | | | | | | | | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000005 | 2019-02-14T17:27:32.088Z | -1 | Edm.Int32 | TaskCompleted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | true | Edm.Boolean | 2019-02-14T17:27:31.849Z | Edm.DateTime | | | | | | | | | [] | Edm.String | 0 | Edm.Int32 | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000006 | 2019-02-14T17:27:32.088Z | 1 | Edm.Int32 | ExecutionCompleted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | false | Edm.Boolean | 2019-02-14T17:27:32.060Z | Edm.DateTime | | | | | | | | | [] | Edm.String | | | Completed | Edm.String | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | 0000000000000007 | 2019-02-14T17:27:32.088Z | -1 | Edm.Int32 | OrchestratorCompleted | Edm.String | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | false | Edm.Boolean | 2019-02-14T17:27:32.078Z | Edm.DateTime | | | | | | | | | | | | | | | | bb1ee432-1f9d-42a1-9401-7481c7c54c7b | sentinel | 2019-02-14T17:27:32.088Z | | | | | 28a8693a972244e0b512f9fc961b54f4 | Edm.String | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
Found the problem, my code running in azure was not as I thought it was. Apologies for wasting your time!
Sorry ‘get_things’ was my attempt at obfuscating!
Oops. You are correct its not the exact same code. I’ll update the code in the original issue.