{"action":"opened","issue":{"url":"https://api.github.com/repos/moq/moq4/issues/738","repository_url":"https://api.github.com/repos/moq/moq4","labels_url":"https://api.github.com/repos/moq/moq4/issues/738/labels{/name}","comments_url":"https://api.github.com/repos/moq/moq4/issues/738/comments","events_url":"https://api.github.com/repos/moq/moq4/issues/738/events","html_url":"https://github.com/moq/moq4/issues/738","id":394843490,"node_id":"MDU6SXNzdWUzOTQ4NDM0OTA=","number":738,"title":"Incomplete stack trace when exceptions when raising events","user":{"login":"MutatedTomato","id":43582046,"node_id":"MDQ6VXNlcjQzNTgyMDQ2","avatar_url":"https://avatars1.githubusercontent.com/u/43582046?v=4","gravatar_id":"","url":"https://api.github.com/users/MutatedTomato","html_url":"https://github.com/MutatedTomato","followers_url":"https://api.github.com/users/MutatedTomato/followers","following_url":"https://api.github.com/users/MutatedTomato/following{/other_user}","gists_url":"https://api.github.com/users/MutatedTomato/gists{/gist_id}","starred_url":"https://api.github.com/users/MutatedTomato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MutatedTomato/subscriptions","organizations_url":"https://api.github.com/users/MutatedTomato/orgs","repos_url":"https://api.github.com/users/MutatedTomato/repos","events_url":"https://api.github.com/users/MutatedTomato/events{/privacy}","received_events_url":"https://api.github.com/users/MutatedTomato/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-30T03:39:26Z","updated_at":"2018-12-30T03:39:26Z","closed_at":null,"author_association":"NONE","body":"When raising an event which throws an exception, the stack trace is terminated at `Raise`. In Mock.Generic.cs around line 571\r\n\r\n\t\t[SuppressMessage(\"Microsoft.Usage\", \"CA2200:RethrowToPreserveStackDetails\", Justification = \"We want to reset the stack trace to avoid Moq noise in it.\")]\r\n\t\tpublic void Raise(Action<T> eventExpression, EventArgs args)\r\n\t\t{\r\n\t\t\tvar (ev, target) = eventExpression.GetEventWithTarget(this.Object);\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\ttarget.DoRaise(ev, args);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\t// Reset stack trace so user gets this call site only.\r\n\t\t\t\tthrow e;\r\n\t\t\t}\r\n\t\t}\r\n\r\nRemoving the try catch should give a full stack trace. There will be noise but there will also be useful information. It is much better than no information."}}
{"actor":{"display_login":"MutatedTomato"}}