Capturing HttpRequestValidationException
Opened this issue · 2 comments
VahidN commented
Hello,
ELMAH does not catch HttpRequestValidationException by default and if a user sends an invalid request it will be missed in ELMAH's report. so it's necessary to define and use this filter as well:
public class ElmahRequestValidationErrorFilter : IExceptionFilter { public void OnException(ExceptionContext context) { if (context.Exception is HttpRequestValidationException) ErrorLog.GetDefault(HttpContext.Current).Log(new Error(context.Exception)); } }
alexbeletsky commented
so would pack a PR for that?
davidgruar commented
#50 should fix this.