Root cause exception is not exposed in durable function orchestrator
See original GitHub issueDescription
This might be more of an oversight or missing for some other reason, anyways here it is:
Throwing an exception in an activity function causes a DurableTask.Core.Exceptions.TaskFailedException
exception. I cannot find a way to extract the root exception from this exception type. Is it supposed to be there? All I get is a message and a type, but the type is an AggregateException
.
Also, the documentation here https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-error-handling?tabs=csharp-isolated#errors-in-activity-functions states that it should be a FunctionFailedException
exception. When I used inprocess durable functions this exception was thrown and it was possible to extract the root exception. In isolated the documentation is wrong.
Expected behavior
The exception thrown contains the root exception
Actual behavior
The exception thrown containsonly the message of the root exception
App Details
- Durable Functions extension version (e.g. v1.8.3): “Microsoft.Azure.Functions.Worker.Extensions.DurableTask” Version=“1.0.0” “Microsoft.Azure.WebJobs.Extensions.DurableTask” Version=“2.9.2”
- Azure Functions runtime version (1.0 or 2.0): 2
- Programming language used: dotnet
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (2 by maintainers)
For
AggregateException
, I believe this is the cause: https://github.com/Azure/azure-functions-dotnet-worker/issues/993.Will need to see if we can even work around this, given it is an issue with the dotnet worker and not durable.
@jviau I believe it has to do with the serialization as you say, and if you remember that it is removed then that is probably it!
@cgillum, DurableTask.Core comes as an inner exception from the aggregate exception.
@jviau, in the above code i get an
AggregateException
but I did not use Task.Result or Task.Wait anywhere here, maybe there is a call to that method inside the code that handles the activities? In the CallActivityAsync maybe?Packages used