public virtual async Task NotifyAsync([NotNull] ExceptionNotificationContext context) { Check.NotNull(context, nameof(context)); foreach (var exceptionSubscriber in ExceptionSubscribers) { try { await exceptionSubscriber.HandleAsync(context); } catch (Exception e) { Logger.LogWarning($"Exception subscriber of type {exceptionSubscriber.GetType().AssemblyQualifiedName} has thrown an exception!"); Logger.LogException(e, LogLevel.Warning); } } }
public abstract Task HandleAsync(ExceptionNotificationContext context);
public Task NotifyAsync(ExceptionNotificationContext context) { return(Task.CompletedTask); }