In this last recipe of the chapter, we want to achieve a smarter exception-handling strategy, and for that we apply some of the lessons we learned about the extensibility features of SignalR, along with some other features specific of error management.
For this recipe, we'll use a new empty web application, which we'll call
How to do it…
Our code will contain a Hub with a couple of methods raising exceptions, and the following steps will illustrate how to work around them in order to collect and manage information about the errors:
- We create a new Hub called
FailingHubusing the SignalR Hub Class (v2) template. The following is what it should look like:
using System; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Hubs; ...