private void OnMonitoringEvent(ResourceMonitorEventArgs e) { try { MonitoringEvent?.Invoke(this, e); } catch (Exception ex) { _logger.LogCritical(0, ex, "The event handler has thrown an exception. The Exception will be re-thrown and the Monitoring will stop."); throw; } }