public void AddError(string message, Exception ex) { if (m_parent != null) { m_parent.AddError(message, ex); } else { lock (Logging.Log.Lock) { if (m_is_reporting) { return; } try { m_is_reporting = true; Logging.Log.WriteMessage(message, Duplicati.Library.Logging.LogMessageType.Error, ex); var s = ex == null ? message : string.Format("{0} => {1}", message, VerboseErrors ? ex.ToString() : ex.Message); m_errors.Add(s); if (MessageSink != null) { MessageSink.ErrorEvent(message, ex); } lock (m_lock) if (m_db != null && !m_db.IsDisposed) { LogDbMessage("Error", message, ex); } } finally { m_is_reporting = false; } } } }
public void AddError(string message, Exception ex) { if (m_parent != null) { m_parent.AddError(message, ex); } else { Logging.Log.WriteMessage(message, Duplicati.Library.Logging.LogMessageType.Error, ex); var s = ex == null ? message : string.Format("{0} => {1}", message, VerboseErrors ? ex.ToString() : ex.Message); m_errors.Add(s); if (MessageSink != null) { MessageSink.ErrorEvent(message, ex); } if (m_db != null && !m_db.IsDisposed) { LogDbMessage("Error", message, ex); } } }