private void OnCloseFeed(object sender, FeedCloseEventArgs e) { _log.LogError("Feed must be closed. Reason: " + e.GetReason()); try { Close(); Closed?.Invoke(this, e); } catch (ObjectDisposedException ex) { _log.LogWarning($"Error happened during closing feed, because the instance {ex.ObjectName} is being disposed."); if (InternalConfig.ExceptionHandlingStrategy == ExceptionHandlingStrategy.THROW) { throw; } } catch (Exception ex) { _log.LogWarning($"Error happened during closing feed. Exception: {ex}"); if (InternalConfig.ExceptionHandlingStrategy == ExceptionHandlingStrategy.THROW) { throw; } } _log.LogInformation("Feed was successfully disposed."); }
/// <summary> /// Invoked when the feed is closed /// </summary> /// <param name="sender">The instance raising the event</param> /// <param name="e">The event arguments</param> private void OnClosed(object sender, FeedCloseEventArgs e) { _log.Warn($"The feed is closed with the reason: {e.GetReason()}"); }