ClientException

sealed class ClientException : Exception

Anything that can go wrong, as one case per kind an app can branch on: the same kinds as every other head (decision 0090). Swift sees an enum with a reason on each case; Kotlin a sealed exception class with one subclass per kind. A case may be added, so switch with a default.

Inheritors

Types

Link copied to clipboard
class Discovery(val reason: String) : ClientException

The service document could not be fetched or read.

Link copied to clipboard
object ErrorHandler : UniffiRustCallStatusErrorHandler<ClientException>
Link copied to clipboard

The address is bound to a different device identity (trust on first use): resume from the saved state, or use another device number.

Link copied to clipboard
class Internal(val reason: String) : ClientException

A protocol or cryptographic failure, or a bug: worth reporting.

Link copied to clipboard

The caller's own input was wrong: a malformed address or config, a message over the size limit.

Link copied to clipboard

The username is not one the server accepts.

Link copied to clipboard
class Network(val reason: String) : ClientException

The network or the transport failed; retry later.

Link copied to clipboard
class NotFound(val reason: String) : ClientException

The address is not registered.

Link copied to clipboard
class RateLimited(val reason: String) : ClientException

The server asked for a slower pace: too many failed sign-ins, or the recipient's queue is full. Back off and retry.

Link copied to clipboard
class ServerFailure(val reason: String) : ClientException

The server could not process the request; nothing was applied.

Link copied to clipboard
class SignInRefused(val reason: String) : ClientException

The credentials were refused, or the session expired. Coarse by design.

Link copied to clipboard
class SignUpRefused(val reason: String) : ClientException

A sign-up was refused for another reason: registration is closed or the handle is reserved.

Link copied to clipboard
class State(val reason: String) : ClientException

The persisted state was refused: altered, older than the last send, or its secure-storage key is wrong. Whatever else a SecureStore implementation raises surfaces as this case, with its reason. Do not delete the blob.

Link copied to clipboard

The platform's secure store could not be reached: a Keychain before first unlock, a Keystore that needs the user. Nothing was refused; retry after unlock and keep the blob. A SecureStore implementation throws this case for exactly that, and the client passes it through.

Link copied to clipboard
class UnknownTenant(val reason: String) : ClientException

The API key selects no tenant.

Link copied to clipboard
class UsernameTaken(val reason: String) : ClientException

The username is already taken in this tenant.

Link copied to clipboard
class WeakPassword(val reason: String) : ClientException

The password is too weak.