internal TransactionAnnouncementError(TransactionAnnouncement transactionAnnouncement, TransactionEvent transactionEvent, string errorType, string errorMessage) { Contract.Requires(transactionAnnouncement != null); Contract.Requires(transactionEvent != null); Contract.Requires(!string.IsNullOrWhiteSpace(errorType)); Contract.Requires(!string.IsNullOrWhiteSpace(errorMessage)); TransactionAnnouncement = transactionAnnouncement; TransactionEvent = transactionEvent; ErrorType = errorType; ErrorMessage = errorMessage; }
public void Announce(Action <TransactionEvent> announceEvent) { Contract.Requires(announceEvent != null); var announcement = new TransactionAnnouncement(this); _announcements.Add(announcement); // sort events to announce in order foreach (var transactionEvent in _events.OrderBy(x => x.Sequence)) { try { announceEvent(transactionEvent); } catch (Exception exception) { announcement.RecordError(transactionEvent, exception.GetType().FullName, exception.ToString()); throw; } } }