public async ValueTask OnMethodBeginAsync(ConsoleAppContext context) { var exceptions = new AggregateExceptionHolder(); foreach (var item in interceptors) { try { await item.OnMethodBeginAsync(context); } catch (Exception e) { exceptions.Add(e); } } exceptions.ThrowIfExists(); }
public async ValueTask OnEngineCompleteAsync(ConsoleAppContext context, string?errorMessageIfFailed, Exception?exceptionIfExists) { var exceptions = new AggregateExceptionHolder(); foreach (var item in interceptors) { try { await item.OnEngineCompleteAsync(context, errorMessageIfFailed, exceptionIfExists); } catch (Exception e) { exceptions.Add(e); } } exceptions.ThrowIfExists(); }
public async ValueTask OnEngineBeginAsync(IServiceProvider serviceProvider, ILogger <ConsoleAppEngine> logger) { var exceptions = new AggregateExceptionHolder(); foreach (var item in interceptors) { try { await item.OnEngineBeginAsync(serviceProvider, logger); } catch (Exception e) { exceptions.Add(e); } } exceptions.ThrowIfExists(); }