DecaneDocs
ReferenceError handling
Reference

Error handling

Errors are DecaneError, a LocalizedError with one case per class. code is identical to the JS SDKs’ error.code, and retryable says whether trying again could succeed.

swift
do {
    try await wallet.verifyEmailCode(email: email, code: code)
} catch let error as DecaneError {
    if error.retryable { showRetry(error.localizedDescription) }
    log(error.code)   // "NETWORK", "RECONNECT_REQUIRED", …
}
CaseCodeMeaning
.networkNETWORKThe request never completed
.reconnectRequiredRECONNECT_REQUIREDSign in again
.sessionExpiredSESSION_EXPIREDThe session ended
.invalidApiKeyINVALID_API_KEYKey invalid or revoked
.walletEnrolmentFailed(cause:)WALLET_ENROLMENT_FAILEDCreation stopped; nothing was left behind, try again
.walletExistsWALLET_EXISTSThe account already has a wallet; it is opened instead
.provisioningRateLimitedPROVISIONING_RATE_LIMITEDToo many new-device setups this hour
.provisioningTimeout(step:)PROVISIONING_TIMEOUTWallet setup took too long
.attestationFailed(message:)ATTESTATION_FAILEDThe enclave could not be verified
.enclaveHTTP(status:message:)ENCLAVE_HTTPAny other enclave error
.callSequence(message:)CALL_SEQUENCEA call made in the wrong state, or not in this version
.platformHookMissing(hook:purpose:)NATIVE_MODULE_MISSINGA feature needs a hook that is not installed
.userCancelledUSER_CANCELLEDThe user dismissed a prompt

The rest (device tier, passkeys and recovery) mirror the JS SDKs: unlockRequired, webAuthnUnsupported, invalidPin, shareCorrupted, newDevice, staleDeviceShare, recoveryFailed, invalidRecoveryFile, wrongPassword, recoveryWalletMismatch, exportNotAuthorized, unlockTokenRejected, biometricUnavailable, originNotAllowed.