{"action":"created","issue":{"url":"https://api.github.com/repos/bugsnag/bugsnag-dotnet/issues/41","labels_url":"https://api.github.com/repos/bugsnag/bugsnag-dotnet/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/bugsnag/bugsnag-dotnet/issues/41/comments","events_url":"https://api.github.com/repos/bugsnag/bugsnag-dotnet/issues/41/events","html_url":"https://github.com/bugsnag/bugsnag-dotnet/issues/41","id":99686598,"number":41,"title":"Overriding original exceptions in ASP.NET MVC","user":{"login":"tkirill","id":4922699,"avatar_url":"https://avatars.githubusercontent.com/u/4922699?v=3","gravatar_id":"","url":"https://api.github.com/users/tkirill","html_url":"https://github.com/tkirill","followers_url":"https://api.github.com/users/tkirill/followers","following_url":"https://api.github.com/users/tkirill/following{/other_user}","gists_url":"https://api.github.com/users/tkirill/gists{/gist_id}","starred_url":"https://api.github.com/users/tkirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkirill/subscriptions","organizations_url":"https://api.github.com/users/tkirill/orgs","repos_url":"https://api.github.com/users/tkirill/repos","events_url":"https://api.github.com/users/tkirill/events{/privacy}","received_events_url":"https://api.github.com/users/tkirill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-07T16:48:48Z","updated_at":"2015-08-12T14:35:36Z","closed_at":null,"body":"TL;DR\r\n\r\nWhen [HandleErrorAttribute](https://msdn.microsoft.com/en-us/library/system.web.mvc.handleerrorattribute%28v=vs.118%29.aspx?f=255&MSPPError=-2147217396) isn't used in the project, Bugsnag overrides original exceptions by exception about not found error view.\r\n\r\n## Description ##\r\n\r\nWe found this exception in our logs:\r\n\r\n    System.InvalidOperationException: The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched:\r\n    ~/Views/Purchase/Error.aspx\r\n    ~/Views/Purchase/Error.ascx\r\n    ~/Views/Shared/Error.aspx\r\n    ~/Views/Shared/Error.ascx\r\n    ~/Views/Purchase/Error.cshtml\r\n    ~/Views/Purchase/Error.vbhtml\r\n    ~/Views/Shared/Error.cshtml\r\n    ~/Views/Shared/Error.vbhtml\r\n       at System.Web.Mvc.ViewResult.FindView(ControllerContext context)\r\n       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)\r\n       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)\r\n       at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)\r\n       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)\r\n       at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)\r\n       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)\r\n       at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)\r\n       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)\r\n       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)\r\n\r\nOur custom error pages are static HTML so we don't need `HandleErrorAttribute` and we don't add it to `GlobalFilters.Filters`.  However, rendering error view is what `HandleErrorAttribute` does and it was strange that the errors appeared in our logs.\r\n\r\nSurprisingly it was `BugsnagExceptionHandler` who tried to render error view.  After we disabled it the error disappears and we could see original exceptions which cause `BugsnagExceptionHandler` to run.\r\n\r\n## Steps to reproduce ##\r\n\r\nI created minimal MVC 5 project to demonstrate and reproduce the problem: [tkirill/bugsnag-eat-exception-reproduce](https://github.com/tkirill/bugsnag-eat-exception-reproduce).\r\n\r\nSteps to reproduce:\r\n\r\n1. Put API key in Web.config.\r\n2. Build project.\r\n3. Navigate to the root page \"/\".\r\n4. Custom 500 page will be displayed.\r\n5. Comment out Bugsnag action filter in Global.asax.cs.\r\n6. Rebuild project.\r\n7. Navigate to the root page \"/\".\r\n8. Custom 500 page will be displayed again.\r\n9. Open C:\\logs\\eat-exceptions.log.\r\n\r\nIn the log file will be two exceptions:\r\n\r\n* One about not found error view. This is the case then Bugsnag action filter activated.\r\n* One about original exception -- InvalidOperationException. This is the case then Bugsnag action filter disabled.\r\n\r\n### Additional possible problem ###\r\n\r\nLikely the same problem occurs when someone use `HandleErrorAttribute` with custom view name set in the corresponding `.View` property.\r\n\r\n## Why ##\r\n\r\nI believe the call of [base.OnException](https://github.com/bugsnag/bugsnag-dotnet/blob/dc97a1b2a3a20ba65c8762846c5632da59c3ead2/src/Bugsnag/Clients/WebMVCClient.cs#L120) causes the problem.  Source code of `HandleErrorAttribute` [proves](https://github.com/mono/aspnetwebstack/blob/master/src/System.Web.Mvc/HandleErrorAttribute.cs#L92) this assumption.\r\n\r\n## What is expected ##\r\n\r\nAs for me the expected behavior of `BugsnagExceptionHandler` is only reporting exceptions to Bugsnag.  Trying to display error page isn't its responsibility."},"comment":{"url":"https://api.github.com/repos/bugsnag/bugsnag-dotnet/issues/comments/130323749","html_url":"https://github.com/bugsnag/bugsnag-dotnet/issues/41#issuecomment-130323749","issue_url":"https://api.github.com/repos/bugsnag/bugsnag-dotnet/issues/41","id":130323749,"user":{"login":"tkirill","id":4922699,"avatar_url":"https://avatars.githubusercontent.com/u/4922699?v=3","gravatar_id":"","url":"https://api.github.com/users/tkirill","html_url":"https://github.com/tkirill","followers_url":"https://api.github.com/users/tkirill/followers","following_url":"https://api.github.com/users/tkirill/following{/other_user}","gists_url":"https://api.github.com/users/tkirill/gists{/gist_id}","starred_url":"https://api.github.com/users/tkirill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkirill/subscriptions","organizations_url":"https://api.github.com/users/tkirill/orgs","repos_url":"https://api.github.com/users/tkirill/repos","events_url":"https://api.github.com/users/tkirill/events{/privacy}","received_events_url":"https://api.github.com/users/tkirill/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T14:35:36Z","updated_at":"2015-08-12T14:35:36Z","body":"@CodeHex I believe #42 fixes the problem but I can't check since the new version wasn't published on NuGet.\r\n\r\nHowever, simply removing `base.OnException` causes another problems.  See #43."}}