Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>$.connection.hub.error</code> is used to handle hub connection failures. You can use jQuery's deferred.fail() to handle an exception thrown from a particular hub invocation (<code>$.connection.hub.methodThatThrows().fail(function() { ... }</code>), but this obviously doesn't handle exceptions thrown from <em>any</em> invocation.</p> <p>SignalR v1.0.0 will add support for <code>IHubPipelineModules</code>. Then you will be able to override <code>HubPipelineModule.BuildIncoming</code> or <code>HubPipelineModule.OnIncomingError</code> which can then be added to the <code>HubPipeline</code> via <code>GlobalHost.HubPipeline.AddModule(myHubPipelineModule)</code>.</p> <p><a href="https://github.com/SignalR/SignalR/issues/548">https://github.com/SignalR/SignalR/issues/548</a></p> <p><a href="https://github.com/SignalR/SignalR/commit/83fdbfd9baa1f1cc3399d7f210cb062597c8084c">https://github.com/SignalR/SignalR/commit/83fdbfd9baa1f1cc3399d7f210cb062597c8084c</a></p> <p>Example implementation:</p> <pre><code>using Microsoft.AspNet.SignalR.Hubs; public class MyHubPipelineModule : HubPipelineModule { protected override void OnIncomingError(ExceptionContext exceptionContext, IHubIncomingInvokerContext invokerContext) { dynamic caller = invokerContext.Hub.Clients.Caller; caller.ExceptionHandler(exceptionContext.Error.Message); } } protected void Application_Start() { GlobalHost.HubPipeline.AddModule(new MyHubPipelineModule()); } // JS // hub.client is also introduced in SignalR v1.0.0 $.connection.myHub.client.exceptionHandler = function (message) { alert(message); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload