private static void InvokeExceptionFilters(
     ClientExceptionContext context, IEnumerable <IClientExceptionFilter> filters)
 {
     foreach (var filter in filters.Reverse())
     {
         filter.OnClientException(context);
     }
 }
        public void Ctor_CorrectlySets_AllProperties()
        {
            var exception = new Exception();
            var context = new ClientExceptionContext(_createContext, exception);

            Assert.Same(exception, context.Exception);
            Assert.False(context.ExceptionHandled);
        }
        public void Run(CreateContext context)
        {
            if (context == null) throw new ArgumentNullException("context");

            var filterInfo = GetFilters(context.Job);

            try
            {
                CreateWithFilters(context, filterInfo.ClientFilters);
            }
            catch (Exception ex)
            {
                var exceptionContext = new ClientExceptionContext(context, ex);

                InvokeExceptionFilters(exceptionContext, filterInfo.ClientExceptionFilters);
                if (!exceptionContext.ExceptionHandled)
                {
                    throw;
                }
            }
        }
        public void Run(CreateContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var filterInfo = GetFilters(context.Job);

            try
            {
                CreateWithFilters(context, filterInfo.ClientFilters);
            }
            catch (Exception ex)
            {
                var exceptionContext = new ClientExceptionContext(context, ex);

                InvokeExceptionFilters(exceptionContext, filterInfo.ClientExceptionFilters);
                if (!exceptionContext.ExceptionHandled)
                {
                    throw;
                }
            }
        }
 private static void InvokeExceptionFilters(
     ClientExceptionContext context, IEnumerable<IClientExceptionFilter> filters)
 {
     foreach (var filter in filters.Reverse())
     {
         filter.OnClientException(context);
     }
 }