Skip to content

Instantly share code, notes, and snippets.

@BryanWilhite
Last active August 29, 2015 14:09
Show Gist options
  • Save BryanWilhite/c1bd61fd31965f03a346 to your computer and use it in GitHub Desktop.
Save BryanWilhite/c1bd61fd31965f03a346 to your computer and use it in GitHub Desktop.
ASP.NET MVC: Controller OnException Override for ELMAH
public class Sample : Controller
{
protected override void OnException(ExceptionContext filterContext)
{
base.OnException(filterContext);
if (!filterContext.ExceptionHandled) return;
var httpContext = filterContext.HttpContext.ApplicationInstance.Context;
var signal = ErrorSignal.FromContext(httpContext);
signal.Raise(filterContext.Exception, httpContext);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment