xt0rted / Raygun.Owin

Owin middleware for Raygun.io
MIT License
3 stars 2 forks source link

Unhandled MVC exception not reported #1

Closed angularsen closed 10 years ago

angularsen commented 10 years ago

Followed your installation instructions. I have a MVC5.1 application. MVC exceptions are not logged, but WebApi exceptions are logged.

Using nuget 0.1.0.

Any ideas?

This is my setup:

 public void Configuration(IAppBuilder app)
        {
            try
            {
                var config = new HttpConfiguration();

                // Raygun error reporting for MVC
                app.UseRaygunUnhandledExceptionLogger();

                // Raygun error reporting for WebApi
                config.Filters.Add(new OwinRequestExceptionLoggerAttribute());
...
}
 public ActionResult About()
        {
            throw new Exception("TEST from About");
        }
xt0rted commented 10 years ago

@anjdreas This is because MVC doesn't run through the OWIN pipeline. To handle exceptions from MVC or WebForms you'll need to edit the Application_Error handler of your Global.asax to send unhandled exceptions to Raygun. You could also add an IHttpHandler like Raygun4Net has done.

The other option is to use Raygun4Net and add your own ExceptionFilterAttribute that sends WebApi errors to Raygun just like the RaygunHttpModule does. This is probably the better of the two options since you're not running in a full OWIN environment. Raygun4Net also has newer features which haven't been added to this project yet.

angularsen commented 10 years ago

Thanks. Yes I also soon realized the nuget was a little dated compared to their own nuget. On May 6, 2014 9:00 AM, "Brian Surowiec" notifications@github.com wrote:

@anjdreas https://github.com/anjdreas This is because MVC doesn't run through the OWIN pipeline. To handle exceptions from MVC or WebForms you'll need to edit the Application_Error handler of your Global.asax to send unhandled exceptions to Raygun. You could also add an IHttpHandlerhttps://github.com/MindscapeHQ/raygun4net/blob/e4dc52d854276c60c7eb9fe7ab32c2380d022f40/Mindscape.Raygun4Net/RaygunHttpModule.cslike Raygun4Net has done.

The other option is to use Raygun4Net and add your own ExceptionFilterAttribute that sends WebApi errors to Raygun just like the RaygunHttpModule does. This is probably the better of the two options since you're not running in a full OWIN environment. Raygun4Net also has newer features which haven't been added to this project yet.

— Reply to this email directly or view it on GitHubhttps://github.com/xt0rted/Raygun.Owin/issues/1#issuecomment-42272743 .