public Task Handle(MessageProcessingExceptionContext <TSource> context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } return(InvokeHandler(context)); }
private async Task InvokeHandler(MessageProcessingExceptionContext <TSource> context) { try { await _handler.Invoke(context); } catch (Exception handlerError) { Trace.TraceError(handlerError.ToString()); } }
private async Task HandleException(MessageProcessingExceptionContext <TSource> context) { foreach (IMessageProcessingExceptionHandler <TSource> handler in _handlers) { try { await handler.Handle(context); } catch (Exception handlerError) { Trace.TraceError(handlerError.ToString()); } } }