DecaneDocs
ReferenceError handling
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)
}
ClassCodeMeaning
NetworkNETWORKThe request never completed
ReconnectRequiredRECONNECT_REQUIREDSign in again
SessionExpiredSESSION_EXPIREDThe session ended
InvalidApiKeyINVALID_API_KEYKey invalid or revoked
WalletEnrolmentFailedWALLET_ENROLMENT_FAILEDCreation stopped; nothing was left behind, sign in again
WalletExistsWALLET_EXISTSThe account already has a wallet; it is opened instead
ProvisioningRateLimitedPROVISIONING_RATE_LIMITEDOpened on too many devices this hour
ProvisioningTimeoutPROVISIONING_TIMEOUTWallet setup took too long
AttestationFailedATTESTATION_FAILEDThe enclave could not be verified
EnclaveHttpENCLAVE_HTTPAny other enclave error; retryable for 5xx
CallSequenceCALL_SEQUENCEA call made in the wrong state, or not in this version
PlatformHookMissingNATIVE_MODULE_MISSINGA feature needs a hook that is not installed
UserCancelledUSER_CANCELLEDThe 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.