I need to implement custom error logging on signalR hubs. This can be done by creating ErrorModule which will inherit from HubPipelineModule and it will be registered on Startup like this
GlobalHost.HubPipeline.AddModule(new ErrorModule());
This is my hub
public class FooHub : Hub
{
public void MethodWithException()
{
throw new Exception();
}
public void FooMethod()
{
}
}
And this is my module
public class ErrorModule : HubPipelineModule
{
protected override void OnIncomingError(ExceptionContext exceptionContext, IHubIncomingInvokerContext invokerContext)
{
//call foo method on foo hub
//log error
}
}
Lets say MethodWithException() is called. It is possible to call FooMethod() on hub which invoked event OnIncomingError ?