Reference
Error handling
Errors are subclasses of the sealed DecaneException. code is identical to the JS SDKs’ error.code, and retryable matches their error.retryable. Branch on the subclass, or on the code when sharing handling with a JS codebase.
kotlin
try {
wallet.verifyEmailCode(email, code)
} catch (e: DecaneException.ReconnectRequired) {
showSignIn()
} catch (e: DecaneException) {
if (e.retryable) showRetry(e.message)
Log.w("decane", e.code)
}| Class | Code | Meaning |
|---|---|---|
Network | NETWORK | The request never completed |
ReconnectRequired | RECONNECT_REQUIRED | Sign in again |
SessionExpired | SESSION_EXPIRED | The session ended |
InvalidApiKey | INVALID_API_KEY | Key invalid or revoked |
WalletEnrolmentFailed | WALLET_ENROLMENT_FAILED | Creation stopped; nothing was left behind, sign in again |
WalletExists | WALLET_EXISTS | The account already has a wallet; it is opened instead |
ProvisioningRateLimited | PROVISIONING_RATE_LIMITED | Opened on too many devices this hour |
ProvisioningTimeout | PROVISIONING_TIMEOUT | Wallet setup took too long |
AttestationFailed | ATTESTATION_FAILED | The enclave could not be verified |
EnclaveHttp | ENCLAVE_HTTP | Any other enclave error; retryable for 5xx |
CallSequence | CALL_SEQUENCE | A call made in the wrong state, or not in this version |
PlatformHookMissing | NATIVE_MODULE_MISSING | A feature needs a hook that is not installed |
UserCancelled | USER_CANCELLED | The user dismissed a prompt |
The device-tier, passkey and recovery errors mirror the JS SDKs: UnlockRequired, WebauthnUnsupported, InvalidPin, ShareCorrupted, NewDevice, StaleDeviceShare, RecoveryFailed, InvalidRecoveryFile, WrongPassword, RecoveryWalletMismatch, ExportNotAuthorized, UnlockTokenRejected, BiometricUnavailable, OriginNotAllowed.