Create a new type HubException that can be thrown from server hub methods. The ctor should take a string message and an object extra error data. SignalR will auto-serialize the exception and send it to the client where it will be used to reject/fail the hub method invocation.
The show detailed hub exceptions setting has no bearing on HubException being sent back to the client or not; it always is.
Flow HubExceptions which to clients even with detailed errors disabled
Tests verifying HubException details are sent to clients
- HubConfiguration.EnableDetailedErrors is false
Reject failed invocation with a single JS object representing HubExce…
@halter73 after updating JabbR, we need a better discriminator sent from server to client to tell if an exception is a hub exception:
I only ever want to show HubExeption but I can't tell which is which unless I happen to pass some error data. Instead let's just flow the type back to the client so it can always tell.
Assigning to @halter73 to do change requested by @davidfowl
Correctly identify HubExceptions with null ErrorData on the clients
Updated HubException related tests to address code review comments
Modified Status.cs (connect status sample hub) to throw a HubException in Ping.
Performed the same verification on JS and C#.