else if (e.Exception is HttpException)
{
if (string.IsNullOrWhiteSpace(e.Exception.Message))
e.Dismiss();
else if (e.Exception.InnerException is System.Web.UI.ViewStateException)
{
if (string.Compare("The client disconnected.", e.Exception.Message, StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (string.Compare("Invalid viewstate.", e.Exception.Message.Left(18), StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (string.Compare("Validation of viewstate MAC failed.", e.Exception.Message.Left(36), StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (string.Compare("The state information is invalid for this page and might be corrupted.", e.Exception.Message.Left(77), StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else
Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(string.Format("Error Filter failed to match msg:[{0}]\n", e.Exception.Message), e.Exception));
}
else if (string.Compare("Invalid viewstate.", e.Exception.Message, StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (string.Compare("This is an invalid webresource request.", e.Exception.Message, StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (string.Compare("The remote host closed the connection. The error code is 0x80070057.", e.Exception.Message, StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (string.Compare("The length of the query string for this request exceeds the configured maxQueryStringLength value.", e.Exception.Message, StringComparison.OrdinalIgnoreCase) == 0)
e.Dismiss();
else if (Regex.IsMatch(e.Exception.Message, "The controller for path '/[^']+' was not found or does not implement IController."))
e.Dismiss();
else if (Regex.IsMatch(e.Exception.Message, "A public action method '[^']+' was not found on controller '[^']+'."))
e.Dismiss();
else if (Regex.IsMatch(e.Exception.Message, "The file '[^']+' does not exist."))
e.Dismiss();
else if (Regex.IsMatch(e.Exception.Message, "Path '[^']+' was not found."))
e.Dismiss();
else if (Regex.IsMatch(e.Exception.Message, @"A potentially dangerous Request.Path value was detected from the client \([^\)]+\)."))
e.Dismiss();
}