/// <summary> /// Processes an exception that occurred while exporting a record /// </summary> /// <param name="exception">Exception</param> public void RecordException(Exception exception, int entityId) { ++RecordsFailed; Log.Error("Error while processing record with id {0}: {1}".FormatInvariant(entityId, exception.ToAllMessages()), exception); if (IsMaxFailures) _result.LastError = exception.ToString(); }
public void LogError(Exception exception, string shortMessage = null, string fullMessage = null, bool notify = false, IList<string> errors = null, bool isWarning = false) { try { if (exception != null) { shortMessage = exception.ToAllMessages(); fullMessage = exception.ToString(); } if (shortMessage.HasValue()) { shortMessage = "PayPal. " + shortMessage; Logger.InsertLog(isWarning ? LogLevel.Warning : LogLevel.Error, shortMessage, fullMessage.EmptyNull()); if (notify) { if (isWarning) _services.Notifier.Warning(new LocalizedString(shortMessage)); else _services.Notifier.Error(new LocalizedString(shortMessage)); } } } catch (Exception) { } if (errors != null && shortMessage.HasValue()) { errors.Add(shortMessage); } }