xt0rted / Raygun.Owin

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

Getting an exception #16

Open kolchy opened 9 years ago

kolchy commented 9 years ago

When I try to throw an exception that I want Raygun to pick up, I get:

Specified method is not supported.

I'm just doing:

throw new InvalidCastException("ex");

I've setup the filter as per the instructions for WebApi:

public class OwinRequestExceptionLoggerAttribute : ExceptionFilterAttribute { public override void OnException(HttpActionExecutedContext actionExecutedContext) { var owinContext = actionExecutedContext.ActionContext.Request.GetOwinContext(); owinContext.Set("webapi.exception", actionExecutedContext.Exception); Elmah.ErrorLog.GetDefault(HttpContext.Current).Log(new Elmah.Error(actionExecutedContext.Exception)); } }