Skip to main content
Interim hand-authored reference. This page is authored directly from the Seam Android SDK public Kotlin sources. See the reference overview for context.

Overview

SeamError is a sealed class that extends Exception. It is the base class for all errors thrown by SeamSDK. Catch SeamError in a try/catch block when calling any SDK method.
sealed class SeamError : Exception()

Subtypes

SubtypeDescription
InitializationRequiredSeamSDK.initialize() has not been called. Call it before using any other SDK method.
ActivationRequiredThe SDK has not been activated. Call SeamSDK.getInstance().activate() first.
IntegrationNotFoundNo provider integration was found for the specified credential. Typically thrown when the integration package (Assa Abloy, Latch, Salto, etc.) is not included in the app.
AlreadyInitializedSeamSDK.initialize() was called while the SDK is already initialized. Call deactivate() first to reinitialize.
DeactivationInProgressA deactivation is already in progress. Wait for it to complete before calling other methods.
InvalidCredentialIdThe credential ID passed to unlock() is not recognized by the SDK.
CredentialErrors(val errors: List<SeamCredentialError>)The credential has one or more unresolved errors. Inspect the errors list before attempting to unlock.
InternetConnectionRequiredAn internet connection is required for this operation.
InvalidClientSessionToken(override val message: String)The client session token passed to initialize() is malformed or invalid.
InvalidUnlockProximityThe unlockProximity passed to unlock() is not supported by the credential.
UnknownAn unexpected or unclassified error occurred.

CredentialErrors

class CredentialErrors(val errors: List<SeamCredentialError>) : SeamError()
Thrown by unlock() when the target credential has one or more active errors that prevent unlocking. The errors list contains SeamCredentialError instances in priority order. See also: SeamCredentialError

InvalidClientSessionToken

class InvalidClientSessionToken(
    override val message: String = "Invalid client session token"
) : SeamError()
Thrown by initialize() when the provided token is malformed. The message property contains a human-readable description of the problem.

Example — Handling unlock() errors

try {
    SeamSDK.getInstance().unlock(
        credentialId = credential.id!!,
        unlockProximity = UnlockProximity.TOUCH
    )
} catch (seamError: SeamError) {
    when (seamError) {
        is SeamError.InitializationRequired -> {
            // SDK not initialized — call SeamSDK.initialize() first
        }
        is SeamError.ActivationRequired -> {
            // SDK not activated — call seamSDK.activate() first
        }
        is SeamError.IntegrationNotFound -> {
            // Provider SDK (e.g. Assa Abloy, Latch, Salto) not found
            // Check that the correct integration module is included
        }
        is SeamError.InvalidCredentialId -> {
            // The credential ID is not recognized
        }
        is SeamError.CredentialErrors -> {
            // Credential has unresolved errors — inspect seamError.errors
            seamError.errors.forEach { credentialError ->
                when (credentialError) {
                    is SeamCredentialError.Expired -> {
                        // credential is expired
                    }
                    is SeamCredentialError.Loading -> {
                        // credential not fully loaded yet — retry shortly
                    }
                    is SeamCredentialError.UserInteractionRequired -> {
                        handleUserInteraction(credentialError.interaction)
                    }
                    is SeamCredentialError.Unknown -> {
                        // unknown credential error
                    }
                }
            }
        }
        is SeamError.InvalidUnlockProximity -> {
            // unlockProximity not supported by this credential
            // Check credential.supportedUnlockProximities
        }
        is SeamError.InternetConnectionRequired -> {
            // No internet — offline unlock may not be possible for this credential
        }
        is SeamError.Unknown -> {
            // Unexpected error
        }
        else -> {
            // Handle any remaining cases
        }
    }
}
See also: SeamCredentialError, SeamSDK