Exemplo n.º 1
0
 /// <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);
     }
 }
Exemplo n.º 2
0
 /// <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()}";