#[non_exhaustive]pub enum ErrorKind {
Show 16 variants
Network,
Discovery,
UnknownTenant,
UsernameTaken,
InvalidUsername,
WeakPassword,
SignUpRefused,
SignInRefused,
IdentityMismatch,
NotFound,
RateLimited,
ServerFailure,
State,
StoreUnavailable,
InvalidArgument,
Internal,
}Expand description
What an app can branch on: the kind of an Error, the same set on
every head (decision 0090, the list before the packages). The message
carries the detail; the kind is the contract. Non-exhaustive: a kind may
be added, so match with a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network
The network or the transport failed, including a reconnect that ran out of patience. Retry later.
Discovery
The server’s service document could not be fetched or read, so the handle does not know where the services are.
UnknownTenant
The API key selects no tenant.
UsernameTaken
The username is already taken in this tenant.
InvalidUsername
The username is not one the server accepts.
WeakPassword
The password is too weak.
SignUpRefused
A sign-up was refused for another reason: registration is closed, the handle is reserved, or (for a tenant) the email is taken or invalid.
SignInRefused
The credentials were refused, or the session they opened has expired. Coarse by design: it does not say whether the account exists.
IdentityMismatch
The address is bound to a different device identity than the one presented (trust on first use). Resume from the saved state that holds the bound identity, or use another device number.
NotFound
The address is not registered: the recipient’s device is gone, or never was.
RateLimited
The server asked for a slower pace: too many failed sign-ins, or the recipient’s queue is full. Back off and retry.
ServerFailure
The server could not process the request; nothing was applied. Retry.
State
The persisted state was refused: altered, older than the last send, or its authenticator did not verify.
The platform’s secure store could not be reached (a Keychain before first unlock, a Keystore that needs the user). Retry after unlock; keep the blob.
InvalidArgument
The caller’s own input was wrong: a malformed address, a message over the size limit. Fix the call, not the network.
Internal
A protocol or cryptographic failure, or an unexpected server reply: a bug on one side or the other, worth reporting.