private static bool IsFiltered(ExceptionContext context)
 {
     var filterConfiguration = context.HttpContext.GetSection("elmah/errorFilter") as ErrorFilterConfiguration;
     if (filterConfiguration == null)
         return false;
     var assertionHelperContext = new ErrorFilterModule.AssertionHelperContext(context.Exception, HttpContext.Current);
     return filterConfiguration.Assertion.Test(assertionHelperContext);
 }
        private static bool IsFiltered(Exception e, HttpContext context)
        {
            if (_config == null)
            {
                _config = context.GetSection("elmah/errorFilter") as ErrorFilterConfiguration
                          ?? new ErrorFilterConfiguration();
            }

            var testContext = new ErrorFilterModule.AssertionHelperContext(e, context);
            return _config.Assertion.Test(testContext);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Determines whether the exception is filtered.
        /// </summary>
        /// <param name="filterContext">The <see cref="ExceptionContext"/>.</param>
        /// <returns>True if exception is filtered, otherwise false.</returns>
        private static bool IsFiltered(ExceptionContext filterContext) 
        {
            var config = filterContext.HttpContext.GetSection("elmah/errorFilter") as ErrorFilterConfiguration;

            if (config == null)
            {
                return false;
            }

            var testContext = new ErrorFilterModule.AssertionHelperContext(filterContext.Exception, HttpContext.Current);

            return config.Assertion.Test(testContext);
        }
Exemplo n.º 4
0
        bool IsFiltered(Exception ex)
        {
            var context = HttpContextProvider.GetContext();

            if (context.IsNull()) return false;

            var config = context.GetSection("elmah/errorFilter") as ErrorFilterConfiguration;

            if (config.IsNull()) return false;

            var testContext = new ErrorFilterModule.AssertionHelperContext(ex, context);

            return config.Assertion.Test(testContext);
        }