Example #1
0
        async Task IFilter <TContext> .Send(TContext context, IPipe <TContext> next)
        {
            try
            {
                await next.Send(context).ConfigureAwait(false);
            }
            catch (AggregateException ex)
            {
                if (!_exceptionFilter.Match(ex.GetBaseException()))
                {
                    throw;
                }

                var rescueContext = _rescueContextFactory(context, ex);

                await _rescuePipe.Send(rescueContext).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                if (!_exceptionFilter.Match(ex))
                {
                    throw;
                }

                var rescueContext = _rescueContextFactory(context, ex);

                await _rescuePipe.Send(rescueContext).ConfigureAwait(false);
            }
        }
        public async Task Send(TContext context, IPipe <TContext> next)
        {
            try
            {
                await _behavior.PreSend().ConfigureAwait(false);

                await next.Send(context).ConfigureAwait(false);

                await _behavior.PostSend().ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                if (!_exceptionFilter.Match(ex))
                {
                    throw;
                }

                await _behavior.SendFault(ex).ConfigureAwait(false);

                throw;
            }
        }
 public bool Matches(Exception exception)
 {
     return(_filter.Match(exception));
 }
 public bool IsHandled(Exception exception)
 {
     return(_filter.Match(exception));
 }
Example #5
0
 bool IRetryPolicy.IsHandled(Exception exception)
 {
     return(_filter.Match(exception));
 }