GSF.TimeSeries.Transport.DataGapRecoverer.OnProcessException C# (CSharp) Method

OnProcessException() protected method

Raises the ProcessException event.
should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
protected OnProcessException ( MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None ) : void
level MessageLevel The to assign to this message
exception System.Exception Processing .
eventName string A fixed string to classify this event; defaults to null.
flags MessageFlags to use, if any; defaults to .
return void
        protected virtual void OnProcessException(MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None)
        {
            try
            {
                Log.Publish(level, flags, eventName ?? "DataGapRecovery", exception?.Message, null, exception);

                using (Logger.SuppressLogMessages())
                    ProcessException?.Invoke(this, new EventArgs<Exception>(exception));
            }
            catch (Exception ex)
            {
                // We protect our code from consumer thrown exceptions
                Log.Publish(MessageLevel.Info, "ConsumerEventException", $"Exception in consumer handler for ProcessException event: {ex.Message}", null, ex);
            }
        }