Error Handling in Fan-Out / Fan-In Pattern #1975
-
I've been implementing a Fan Out / Fan In pattern, and I'm having difficulty appropriately catching and handling the errors. Is there some documentation or recommendation on how to properly handle errors when one of the activities in this scenario failes? I've tried three separate approaches, and in all cases, error logs still seem to show an uncaught exception. Here are simplified example attempts: Situation A: Try Catch surrounding entire block:
Situation B: Try Catch Individually
Try Catch Embedded into a function
I have also tried these situations with a RetryOptions option in conjunction with CallActivityWithRetryAsync. Update based on more research: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The error handling experience for fan-out/fan-in in Durable Functions is the same as it would be for a normal C# app since Durable Functions are just using C# tasks for orchestration.
Yes, we log activity function errors immediately after an activity fails, regardless of whether the orchestration attempts to handle the exception. If the orchestration doesn't handle the exception, then you'll see a second error message in the logs, this time for the orchestrator function itself.
Removing the try/catch would cause your orchestrator function to fail as part of the |
Beta Was this translation helpful? Give feedback.
The error handling experience for fan-out/fan-in in Durable Functions is the same as it would be for a normal C# app since Durable Functions are just using C# tasks for orchestration.
Yes, we log activity function errors immediately after an activity fails, regardless of whether the orchestration attempts to handle the exception. If the orchestration doesn't handle the exception, then you'll see a second error message in the logs, this time for the orchestrator function itself.