[SignalR] How to use IHubFilter to catch exceptions #30023
Unanswered
MathiasNysomFlohr
asked this question in
Q&A
Replies: 1 comment
-
Created in the wrong repo. Moved here: dotnet/aspnetcore#49993 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are creating a generalized way to catch and handle exceptions in our Hubs to ensure clean exists.
We are currently ending all our hubs in a method inspired by https://stackoverflow.com/questions/59020363/try-catch-using-iasyncenumerable-in-signalr-asp-net-core-3-0.
We want to move the relevant code to a HubFilter to keep the Hub clean and ensure error handling is done similarly across hubs.
We have tried building a IHubFilter with the following InvokeMethodAsync:
However, it seems that we do not get into the Add-method, and we don't hit any breakpoints in the lower leves of the enumerable. If we return res or asyncRes, we hit these breakpoints.
It seems like SignalR does not handle the new IAsyncEnumerable from the Add-method.
How can we solve this, so we are able to have generalized error handling?
Thank you for your time.
Beta Was this translation helpful? Give feedback.
All reactions