/// <summary> /// Handler for an IrisError. /// Fires a log event if LogErrorsEnable is true. /// </summary> /// <param name="error">The IrisError received.</param> protected virtual void OnError(IrisError error) { if (LogErrorsEnable) { OnLog?.BeginInvoke(GetLogForError(error), null, null); } }
/// <summary> /// Builds a string for logging the error received. /// </summary> /// <param name="error">The IrisError received.</param> /// <returns>A log string.</returns> protected string GetLogForError(IrisError error) => $"[Error];{nameof(error.PublisherId)}: {error.PublisherId};{nameof(error.Exception)}: {error.Exception?.GetFullExceptionMessage()}";