Class EmailContentReadFailure
- Namespace
- MailFathom.Application.Emails.GetEmailContent
- Assembly
- MailFathom.Application.dll
Why one named email carries no content, stated as a result rather than raised.
public sealed record EmailContentReadFailure : IEquatable<EmailContentReadFailure>
- Inheritance
-
EmailContentReadFailure
- Implements
- Inherited Members
Remarks
It is a result because the caller acts on it and continues: a read names several emails, and one this deployment cannot serve must not discard the content of the others. An exception would travel past the loop that is in a position to decide what it means, which is exactly the distinction the repository's failure rules draw.
The codes are the ones the single-email read already published, so a caller matching on `53002` or `55001` reads the same fact whether it named one email or ten. The message is written here rather than at the protocol boundary, so one text exists for one failure and the tests of this use case cover the wording a client is shown.
A message names the email's own identifier, which is MailFathom's own handle for it and carries nothing the caller did not already write. Nothing else may enter it: no subject, no address, no body text, no defect the caller cannot act on beyond the one this system found in its own storage.
Constructors
- EmailContentReadFailure(MailFathomErrorCode, string)
Why one named email carries no content, stated as a result rather than raised.
Properties
- ErrorCode
The stable code identifying the failure.
- Message
The sentence written for whoever, or whatever, reads the result.
Methods
- ContentUnavailable(StoredEmailId, EmailContentDefect)
Reports an email that is stored and whose content cannot be served.
- NotFound(StoredEmailId)
Reports an email the local mailbox copy holds no row for.