Table of Contents

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

session IPersistenceSession

The session the write joins.

lease OutgoingEmailLease

The lease the attempt holds the record under.

outgoingEmailId OutgoingEmailId

The record the attempt belonged to.

failure MailFathomErrorCode

The code identifying what ended the attempt.

cancellationToken CancellationToken

Cancels 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 session or lease is 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.