From 4ed15f0db82537ea2654eea6a9e25b74f86467a6 Mon Sep 17 00:00:00 2001 From: kayone Date: Sat, 30 Nov 2013 17:51:52 -0800 Subject: [PATCH] added logging for signalr exception --- .../Infrastructure/Connection.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Microsoft.AspNet.SignalR.Core/Infrastructure/Connection.cs b/src/Microsoft.AspNet.SignalR.Core/Infrastructure/Connection.cs index bb0782de6..f29063f7f 100644 --- a/src/Microsoft.AspNet.SignalR.Core/Infrastructure/Connection.cs +++ b/src/Microsoft.AspNet.SignalR.Core/Infrastructure/Connection.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -234,6 +235,12 @@ namespace Microsoft.AspNet.SignalR.Infrastructure else if (message.IsCommand) { var command = _serializer.Parse(message.Value, message.Encoding); + + if (command == null) + { + throw new SerializationException("Couldn't parse message " + message.Value); + } + ProcessCommand(command); // Only send the ack if this command is waiting for it