O'Reilly logo

SignalR Real-time Application Cookbook by Roberto Vespa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing errors across a complex asynchronous workflow

In the last recipe of the chapter, as we did in Chapter 3, Using the JavaScript Hubs Client API, we'll learn how to handle errors occurring during all the possible SignalR operational steps and connection states.

The HubConnection class from the .NET client offers a specific Error event, which is useful to manage most of the exceptions raised by SignalR itself, whereas any server-side exception occurring during a Hub method invocation can be trapped simply by surrounding the client-side invocation in a try...catch block. We'll talk a little bit more about the latter case while commenting on the code of this recipe.

Getting ready

Before proceeding with this recipe, please remember to start the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required