Last active
August 29, 2015 14:09
-
-
Save BryanWilhite/c1bd61fd31965f03a346 to your computer and use it in GitHub Desktop.
ASP.NET MVC: Controller OnException Override for ELMAH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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