Managing errors across a complex asynchronous workflow

In this last recipe, we'll introduce one last concept to have a full view of the basic features made available by the JavaScript Hubs API: how to react to errors that occur during all the possible SignalR operational steps and states.

For some specific cases, SignalR offers a couple of native ways to deal with errors as follows:

  • We can supply a fail() callback to any JavaScript promise object that SignalR returns. This means that we can either use fail() on the promise object returned when starting a connection to intercept errors during the connection process, or we can use fail() on the promise object returned during the remote invocation of a Hub method. By hooking a callback with these ...

Get SignalR Real-time Application Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.