public void Run(PerformContext context, IJobPerformer performer) { if (context == null) { throw new ArgumentNullException("context"); } if (performer == null) { throw new ArgumentNullException("performer"); } var filterInfo = GetFilters(context.Job); try { PerformJobWithFilters(context, performer, filterInfo.ServerFilters); } catch (OperationCanceledException) { throw; } catch (Exception ex) { var exceptionContext = new ServerExceptionContext(context, ex); InvokeServerExceptionFilters(exceptionContext, filterInfo.ServerExceptionFilters); if (!exceptionContext.ExceptionHandled) { throw; } } }
public void Run(PerformContext context, IJobPerformer performer) { if (context == null) throw new ArgumentNullException("context"); if (performer == null) throw new ArgumentNullException("performer"); var filterInfo = GetFilters(context.Job); try { PerformJobWithFilters(context, performer, filterInfo.ServerFilters); } catch (OperationCanceledException) { throw; } catch (Exception ex) { var exceptionContext = new ServerExceptionContext(context, ex); InvokeServerExceptionFilters(exceptionContext, filterInfo.ServerExceptionFilters); if (!exceptionContext.ExceptionHandled) { throw; } } }
private static void InvokeServerExceptionFilters( ServerExceptionContext context, IEnumerable <IServerExceptionFilter> filters) { foreach (var filter in filters.Reverse()) { filter.OnServerException(context); } }
private static void InvokeServerExceptionFilters( ServerExceptionContext context, IEnumerable<IServerExceptionFilter> filters) { foreach (var filter in filters.Reverse()) { filter.OnServerException(context); } }