ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,834 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using the C# SignalR client library, and I caused an exception inside one of my message handlers. (Oops!) I noticed that it silently abandons the handler. Is there any way to specify a general exception handler for when a given delegate fails to handle it? Or do I need to wrap each handler individually in a try-catch block?
connection.On("CreateMessage", () => throw new Exception("Oops!"));
I call
connection.On(...)
a dozen times to map a dozen handlers. Do I have to put atry-catch
around the bodies of every single handler? Or is there way to register a global exception handler for any message handler that throws an exception?Do I have to put a try-catch around the bodies of every single handler? Or is there way to register a global exception handler for any message handler that throws an exception?
As far as I know, currently it seems not support register a global exception handler on SignalR client side.