API reference

SessionError Enum

Enum representing errors that can occur during session lifecycle operations in the DAT SDK.
Session errors cover creation, start, stop, capability management, and runtime device issues. These errors are returned from Wearables.createSession, emitted via Session.errors, or returned from capability add/remove operations. Use exhaustive when matching to handle all error variants.
Example:
session.errors.collect { error ->
    when (error) {
        SessionError.DEVICE_DISCONNECTED -> showReconnectPrompt()
        SessionError.DEVICE_POWERED_OFF -> showDeviceOffMessage()
        SessionError.SESSION_ENDED_BY_DEVICE -> showSessionEndedMessage()
        else -> showGenericError(error.description)
    }
}

See Also

Signature

enum SessionError : Enum<SessionError> , DatError

Enumeration Constants

MemberDescription
NOT_INITIALIZED
The SDK has not been initialized. Call Wearables.initialize before creating sessions.
NO_ELIGIBLE_DEVICE
No connected and compatible device was found matching the provided device selector.
SESSION_ALREADY_STOPPED
The operation was called on a session that has already been stopped.
SESSION_IDLE
The operation was called on a session that is still idle (not yet started).
CAPABILITY_ALREADY_ADDED
A capability of this type has already been added to the session.
CAPABILITY_NOT_FOUND
No capability of this type exists on the session to remove.
DEVICE_DISCONNECTED
The device disconnected unexpectedly during an active session.
DEVICE_POWERED_OFF
The device was powered off during an active session.
SESSION_ENDED_BY_DEVICE
The session was ended by the device (e.g., device-initiated stop).
SESSION_ALREADY_EXISTS
The session already exists and is active for the device.
UNEXPECTED_ERROR
An unexpected error occurred during the session.

Properties

description : String
[Get]
Human-readable description of the error
Signature
open override val description: String

Methods

getLocalizedDescription ( context )
Returns a localized description of the error using Android string resources when available.
Signature
open override fun getLocalizedDescription(context: Context?): String
Parameters
context: Context?  Optional Android context for accessing string resources. If null or if no localized string is available, returns the default SessionError.description.
Returns
String  The localized error description, or the default description if localization unavailable.