Struct MailFathomErrorCode
- Namespace
- MailFathom.Domain.Failures
- Assembly
- MailFathom.Domain.dll
Identifies a failure MailFathom raised deliberately, as a five-digit code stable enough to publish.
[JsonConverter(typeof(MailFathomErrorCodeJsonConverter))]
public readonly record struct MailFathomErrorCode : IEquatable<MailFathomErrorCode>
- Implements
- Inherited Members
Remarks
The type is a closed enumeration of values rather than a C# enum, because the number is the identity: it is what a log records, what an alert matches, and what a support conversation names. An enum member's ordinal would carry no meaning outside this assembly, and its name would change with every rename of the failure it belongs to.
The code reads as C S NNN: the first digit is the Category, the second is the
Subcategory within it, and the last three number the failure inside that subcategory. A reader who
sees 21001 knows it is a mail-protocol failure about authentication before looking anything up.
Numbers are allocated once and never reused or renumbered, for the same reason an enum member's value is never reordered: a code that changes meaning silently invalidates every runbook, alert, and log search written against it. Being a struct, default is reachable and names no failure; IsSpecified reports that, and every failure reaches its code through a declared member, so the default cannot arrive from a raised exception.
The cost against an enum is that the members are not compile-time constants, so a boundary translates them through a lookup rather than through a switch over constants.
Properties
- All
Gets every allocated code.
- AnsweredEmailContentUnavailable
Gets subcategory 8, message composition: the email being answered has no content this deployment can read.
- AnsweredEmailNotFound
Gets subcategory 8, message composition: there is no such stored email to answer, as far as the caller may be told.
- AnsweredEmailUnavailable
Gets subcategory 3, access: a request asked to answer an email this deployment will not answer.
- AuthoredMailBoundExceeded
Gets subcategory 1, request validation: a message a caller authored is larger than this deployment composes.
- AuthoredMailFieldRefused
Gets subcategory 1, request validation: a field of a message a caller authored carries a value no message can be composed from.
- AuthoredMailRecipientUnresolved
Gets subcategory 3, access: a recipient a message was addressed to by naming somebody resolved to nobody the contact book holds.
- AuthoredMailScheduleRefused
Gets subcategory 1, request validation: a caller asked for a message to leave at a time this system cannot hold it for.
- Category
Gets the subsystem the failure belongs to, which is the code's first digit.
- ChatAnswerEmpty
Gets subcategory 3, answer shape: a chat provider ended the call with no text to present.
- ChatProviderCredentialRejected
Gets subcategory 1, credentials: a chat provider refused the credential this deployment presented.
- ChatProviderUnavailable
Gets subcategory 2, availability: the declared chat endpoint did not answer within the budget configured for it.
- ContactCursorMalformed
Gets subcategory 2, pagination: a contact continuation cursor is not one this system issued.
- ContactIdentifierMalformed
Gets subcategory 1, request validation: a request named a contact by text that is not an identifier this system issues.
- ContactQueryInvalid
Gets subcategory 1, request validation: a contact listing named a page size, an origin, or a search text the book does not serve.
- ContactRecordInvalid
Gets subcategory 1, request validation: a contact record a write states breaks a rule the book holds.
- DatabaseSchemaOutOfDate
Gets subcategory 2, schema state: the database does not carry every migration the running build was compiled against.
- DatabaseSchemaStateUnreadable
Gets subcategory 2, schema state: the migration history could not be read, so the schema is of unknown shape.
- DatabaseSchemaTextSearchConfigurationMismatch
Gets subcategory 2, schema state: the lexical index was built with a different text search configuration than the one configured.
- EmailContentReadCountOutOfRange
Gets subcategory 1, request validation: a content read named no emails, or more emails than one call serves.
- EmailContentReadDuplicateEmail
Gets subcategory 1, request validation: a content read named the same email more than once.
- EmailContentReadSelectionInvalid
Gets subcategory 1, request validation: a content read named both the emails and the thread to read, or neither.
- EmailContentUnavailable
Gets subcategory 5, local consistency: an email exists locally, but the content stored for it is missing, damaged, or unreadable.
- EmailSearchResultLimitOutOfRange
Gets subcategory 1, request validation: an email search asked for more ranked results than the search serves.
- EmailThreadIdentifierMalformed
Gets subcategory 1, request validation: a request named a thread by text that is not an identifier this system issues.
- EmbeddingProviderCredentialRejected
Gets subcategory 1, credentials: an embedding provider refused the credential this deployment presented.
- EmbeddingProviderUnavailable
Gets subcategory 2, availability: no endpoint of the declared chain served an embedding request within the budget configured for it.
- EmbeddingVectorIndexUnavailable
Gets subcategory 3, vector indexes: the approximate index one embedding profile's vectors are searched through is not in the state its lifecycle asked for.
- EmbeddingVectorShapeUnexpected
Gets subcategory 3, answer shape: a provider returned a vector the declared geometry does not describe.
- EnvironmentOnlySettingMisplaced
Gets subcategory 2, configuration sources: a setting only the process environment can deliver carries a value that came from somewhere else.
- IsSpecified
Gets whether this value names an allocated code rather than the unusable struct default.
- JobPayloadTooLarge
Gets subcategory 4, durable jobs: a job payload serialized to more than the enqueue boundary accepts.
- MailAccessTokenUnavailable
Gets subcategory 3, mailbox access tokens: an account's authorization server did not issue an access token its OAuth mechanisms require.
- MailAccountNotAccessible
Gets subcategory 3, access: a request named a mail account this deployment does not serve.
- MailAnsweringBudgetExhausted
Gets subcategory 7, spend ceilings: answering a question would exceed a ceiling this deployment configured on what it spends.
- MailAnsweringUnavailable
Gets subcategory 6, capability: a request asked for something this deployment does not currently serve.
- MailAuthenticationMechanismUnavailable
Gets subcategory 1, authentication: a mail server advertises no authentication mechanism the account's policy permits.
- MailDeliveryUnavailable
Gets subcategory 7, delivery sessions: a submission server did not serve an operation within the resilience budget configured for it.
- MailDraftNotAddressed
Gets subcategory 3, the thing named: a draft was asked to be sent and names nobody to send it to.
- MailDraftNotFound
Gets subcategory 3, access: no draft this deployment holds is kept under the identifier a caller named.
- MailFlagChangeInvalid
Gets subcategory 1, request validation: a request to write flags or keywords on an email states no usable change.
- MailFolderRoleUnmapped
Gets subcategory 3, access: a request named a folder by a role no folder in scope is mapped with.
- MailSendingNotEnabled
Gets subcategory 6, capability: this deployment holds no capability to send as the account a message names.
- MailSendingUnavailable
Gets subcategory 6, capability: the account a message would be sent as configures no way to send it.
- MailTransportSecurityPolicyViolated
Gets subcategory 1, transport security policy: a configured combination would weaken protection in a way no opt-in allows.
- MailboxAnswerIncomplete
Gets subcategory 4, answer completeness: a mail server answered for an email without the data items the command requested.
- MailboxAuthorizationFailed
Gets subcategory 3, mailbox access tokens: an operator-driven authorization run did not produce a refresh token to provision.
- MailboxFolderRecreated
Gets subcategory 3, folder identity: a folder was reselected with a UIDVALIDITY that makes the session's identities name different emails.
- MailboxMutationAttemptsExhausted
Gets subcategory 5, mutation support: a mutation spent its bounded attempts without completing.
- MailboxMutationDestinationMissing
Gets subcategory 5, mutation support: the folder a relocation or a copy names as its destination does not exist on the server.
- MailboxMutationFailedUnexpectedly
Gets subcategory 5, mutation support: a mutation ended in a failure this system does not classify.
- MailboxMutationOutcomeUnknown
Gets subcategory 5, mutation support: a command that must never be issued twice went out and its answer never came back.
- MailboxMutationUnsupported
Gets subcategory 5, mutation support: a mail server advertises no extension able to carry a requested change safely.
- MailboxQueryCursorFilterMismatch
Gets subcategory 2, pagination: a continuation cursor was issued for a different set of filters than the request carries.
- MailboxQueryCursorMalformed
Gets subcategory 2, pagination: a continuation cursor is not one this system issued.
- MailboxQueryFilterInvalid
Gets subcategory 1, request validation: one filter of a mailbox query carries a value, a count, or a length the query does not accept.
- MailboxQueryPageSizeOutOfRange
Gets subcategory 1, request validation: a mailbox query asked for a page size outside the range the query serves.
- MailboxUnavailable
Gets subcategory 2, session availability: a mail server did not serve an operation within the resilience budget configured for it.
- McpToolFailedUnexpectedly
Gets subcategory 4, undiagnosed failure: a tool call failed for a reason the boundary deliberately does not describe.
- OutboundDependencyUnavailable
Gets subcategory 1, pipeline rejection: a resilience pipeline declined to serve an operation against an outbound dependency any further.
- OutgoingEmailAttemptsExhausted
Gets subcategory 8, message composition: a send spent every attempt it was allowed on failures that could have cleared.
- OutgoingEmailBoundExceeded
Gets subcategory 8, message composition: a message exceeds a bound the deployment configured or the submission server advertised.
- OutgoingEmailContactAddressNotHeld
Gets subcategory 8, message composition: the address an authored act chose for a contact is not one that contact uses.
- OutgoingEmailContactNameAmbiguous
Gets subcategory 8, message composition: the name a recipient was addressed by is carried by more than one contact.
- OutgoingEmailContactUnknown
Gets subcategory 8, message composition: the contact a recipient was named by is not one the book holds.
- OutgoingEmailDeliveryFailedUnexpectedly
Gets subcategory 8, message composition: a delivery attempt ended in a failure the outbox does not recognize.
- OutgoingEmailDueTimeMissed
Gets subcategory 8, message composition: a send reached its delivery attempt later than the deployment is willing to deliver a message written for a time that has passed.
- OutgoingEmailFieldUnusable
Gets subcategory 8, message composition: an author-supplied field carries a value no message can be composed from.
- OutgoingEmailFilingDestinationUnavailable
Gets subcategory 9, message filing: there is no folder to put a copy of an outgoing message into.
- OutgoingEmailFilingFailedUnexpectedly
Gets subcategory 9, message filing: a filing attempt ended in a failure this system does not recognize.
- OutgoingEmailFilingOutcomeUnknown
Gets subcategory 9, message filing: an append went out and the server's answer to it never came back.
- OutgoingEmailHeaderInjected
Gets subcategory 8, message composition: an author-supplied field carries a line break, which would smuggle a header nobody wrote.
- OutgoingEmailIdentifierMalformed
Gets subcategory 1, request validation: a request named a queued send by text that is not an identifier this system issues.
- OutgoingEmailInternationalizationUnsupported
Gets subcategory 8, message composition: an address outside ASCII was addressed to a server that advertised no internationalized-address support.
- OutgoingEmailLeaseLost
Gets subcategory 8, message composition: the queued send an attempt was writing to is held by a later attempt.
- OutgoingEmailNoLongerCancellable
Gets subcategory 8, a state already passed: a queued send can no longer be withdrawn, because it is being transmitted or has been.
- OutgoingEmailNotFound
Gets subcategory 3, access: a request named a queued send this caller did not ask for, or none at all.
- OutgoingEmailOutcomeUnknown
Gets subcategory 8, message composition: a send's message went out and the server's answer to it never came back.
- OutgoingEmailRefused
Gets subcategory 8, message composition: a submission server refused the message for good.
- OutgoingEmailSenderUnconfigured
Gets subcategory 8, message composition: the account a message would be sent as configures no address to send from.
- OutgoingMailCeilingReached
Gets subcategory 7, ceilings: sending a message would carry a period past a ceiling this deployment configured on how much mail may leave.
- OutgoingRecipientRefusedByPolicy
Gets subcategory 3, access: a message named a recipient the deployment's recipient policy does not admit.
- OutgoingRecipientUnvouched
Gets subcategory 3, access: a caller named a recipient nothing this deployment holds vouches for.
- PersistenceConcurrencyConflict
Gets subcategory 1, concurrent writes: a local write did not commit because another writer changed the same durable state.
- PersonalDataAnalyzerUnavailable
Gets subcategory 1, availability: the personal-data analyzer this deployment configured could not be reached while the host was starting.
- PrincipalNotAuthorized
Gets subcategory 4, principal authorization: a use case was reached by a principal that was not granted it.
- ProvisionedConfigurationSourceInvalid
Gets subcategory 2, configuration sources: the deployment's configuration-source settings name a path that is absent or a setting that does not exist.
- RemoteFolderCreationRefused
Gets subcategory 6, folder creation: a mail server refused to create the folder a mapping asked for.
- SensitiveContentScannerUnavailable
Gets subcategory 1, availability: a scanner that guards content leaving the process could not produce findings.
- SpamScannerUnavailable
Gets subcategory 1, availability: the spam scanner this deployment configured could not be reached while the host was starting.
- StoredEmailIdentifierMalformed
Gets subcategory 1, request validation: a request named an email by text that is not an identifier this system issues.
- StoredEmailNotFound
Gets subcategory 3, access: a request named an email the local mailbox copy holds no row for.
- Subcategory
Gets the concern within the category, which is the code's second digit.
- Value
Gets the five-digit code.
Methods
- ToString()
Returns the five-digit code, so a log or an error response records the number rather than the structure.
- TryParse(int, out MailFathomErrorCode)
Parses a recorded five-digit code back into the value it names.