protected virtual void OnMessageReceived(JToken message)
{
if (Received != null)
{
// #1889: We now have a try-catch in the OnMessageReceived handler. One note about this change is that
// messages that are triggered via responses to server invocations will no longer be wrapped in an
// aggregate exception due to this change. This makes the exception throwing behavior consistent across
// all types of receive triggers.
try
{
Received(message.ToString());
}
catch (Exception ex)
{
OnError(ex);
}
}
}