{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/SignalR/issues/62","repository_url":"https://api.github.com/repos/aspnet/SignalR","labels_url":"https://api.github.com/repos/aspnet/SignalR/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/SignalR/issues/62/comments","events_url":"https://api.github.com/repos/aspnet/SignalR/issues/62/events","html_url":"https://github.com/aspnet/SignalR/issues/62","id":193836374,"number":62,"title":"Catch exceptions from formatters","user":{"login":"moozzyk","id":1438884,"avatar_url":"https://avatars.githubusercontent.com/u/1438884?v=3","gravatar_id":"","url":"https://api.github.com/users/moozzyk","html_url":"https://github.com/moozzyk","followers_url":"https://api.github.com/users/moozzyk/followers","following_url":"https://api.github.com/users/moozzyk/following{/other_user}","gists_url":"https://api.github.com/users/moozzyk/gists{/gist_id}","starred_url":"https://api.github.com/users/moozzyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moozzyk/subscriptions","organizations_url":"https://api.github.com/users/moozzyk/orgs","repos_url":"https://api.github.com/users/moozzyk/repos","events_url":"https://api.github.com/users/moozzyk/events{/privacy}","received_events_url":"https://api.github.com/users/moozzyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-06T17:36:03Z","updated_at":"2016-12-06T17:36:03Z","closed_at":null,"body":"Since formatters are pluggable they can fail in unexpected ways bringing the server down e.g:\r\n\r\n```\r\nUnhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at Microsoft.AspNetCore.SignalR.JsonNetInvocationAdapter.<>c__DisplayClass2_0.<ReadInvocationDescriptorAsync>b__0() i\r\nn C:\\source\\SignalR-Core\\src\\Microsoft.AspNetCore.SignalR\\JsonNetInvocationAdapter.cs:line 40\r\n   at System.Threading.Tasks.Task`1.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at Microsoft.AspNetCore.SignalR.HubEndPoint`2.<DispatchMessagesAsync>d__9.MoveNext() in C:\\source\\SignalR-Core\\src\\Mi\r\ncrosoft.AspNetCore.SignalR\\HubEndPoint.cs:line 105\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n   at Microsoft.AspNetCore.SignalR.HubEndPoint`2.<OnConnectedAsync>d__8.MoveNext() in C:\\source\\SignalR-Core\\src\\Microso\r\nft.AspNetCore.SignalR\\HubEndPoint.cs:line 77\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.SignalR.HubEndPoint`2.<OnConnectedAsync>d__8.MoveNext() in C:\\source\\SignalR-Core\\src\\Microso\r\nft.AspNetCore.SignalR\\HubEndPoint.cs:line 95\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n   at Microsoft.AspNetCore.Sockets.HttpConnectionDispatcher.<>c__DisplayClass4_0`1.<<ExecuteAsync>b__0>d.MoveNext() in C\r\n:\\source\\SignalR-Core\\src\\Microsoft.AspNetCore.Sockets\\HttpConnectionDispatcher.cs:line 116\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.QueueUserWorkItemCallbackDefaultContext.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()\r\n   at System.Threading.ThreadPoolWorkQueue.Dispatch()\r\n```\r\n\r\nWe need to catch exceptions and handle them."}}
{"actor":{"display_login":"moozzyk"}}