Method RecordFailureAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
RecordFailureAsync(IPersistenceSession, MailboxMutationRecordId, MailFathomErrorCode, CancellationToken)
Records the failure the last attempt ended in, without moving the stage.
Task RecordFailureAsync(IPersistenceSession session, MailboxMutationRecordId recordId, MailFathomErrorCode failure, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins.
recordIdMailboxMutationRecordIdThe 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 sequence actually got to, which is what a resumed attempt reads; the failure says why it got no further.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no record carries
recordId.