You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created a middleware to centrally handle various types of exceptions.
Before my change, I had a try-catch block in my TaskActivity.Execute() method:
This worked fine regarding retries when an exception is thrown.
However, when I moved this logic to a middleware, RetryOptions were disregarded, and the same activity was retried over-and-over indefinitely:
Is there some guidance on handling exceptions in middleware? Is there a correct way to handle this scenario?
I've tried simulating the behavior of the dispatcher, and managed to get this to work, but that feels incorrect:
The current design of the middleware pipeline doesn't really help with exception handling, as you've noticed. It's very low-level and assumes knowledge of how the dispatcher works. I think we'd need some enhancements or redesigns to create a more developer-friendly experience for middleware.
Thanks for the update.
Is my suggested solution technically correct?
Should I go that way until the team come up with a better design?
Is that in the near-future roadmap?
I've created a middleware to centrally handle various types of exceptions.
Before my change, I had a try-catch block in my
TaskActivity.Execute()
method:This worked fine regarding retries when an exception is thrown.
However, when I moved this logic to a middleware, RetryOptions were disregarded, and the same activity was retried over-and-over indefinitely:
Is there some guidance on handling exceptions in middleware? Is there a correct way to handle this scenario?
I've tried simulating the behavior of the dispatcher, and managed to get this to work, but that feels incorrect:
@cgillum @davidmrdavid
The text was updated successfully, but these errors were encountered: