Method RecordFailureAsync
- Namespace
- MailFathom.Application.Mail.Delivery
- Assembly
- MailFathom.Application.dll
RecordFailureAsync(IPersistenceSession, OutgoingEmailLease, OutgoingEmailId, MailFathomErrorCode, CancellationToken)
Records the failure the last attempt ended in, without moving the stage.
Task RecordFailureAsync(IPersistenceSession session, OutgoingEmailLease lease, OutgoingEmailId outgoingEmailId, MailFathomErrorCode failure, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
leaseOutgoingEmailLeaseThe lease the attempt holds the record under.
outgoingEmailIdOutgoingEmailIdThe record the attempt belonged to.
failureMailFathomErrorCodeThe code identifying what ended the attempt.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the failure is written.
Remarks
The stage stays where the attempt actually got to, which is what a later one reads; the failure says why it got no further.
Exceptions
- ArgumentNullException
Thrown when
sessionorleaseis null.- OutgoingEmailLeaseLostException
Thrown when the record is held by a later attempt.
- InvalidOperationException
Thrown when no record carries
outgoingEmailId, or when it has reached a terminal stage.