when matching to handle all error variants.
session.errors.collect { error ->
when (error) {
DeviceSessionError.DEVICE_DISCONNECTED -> showReconnectPrompt()
DeviceSessionError.SESSION_ENDED_BY_DEVICE -> showSessionEndedMessage()
else -> showGenericError(error.description)
}
}
enum DeviceSessionError : Enum<DeviceSessionError> , DatError
| Member | Description |
|---|---|
CAPABILITY_DENIED |
The device denied the requested capability. The app may not have the required permission.
|
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.
|
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.
|
THERMAL_CRITICAL |
The device reached a critical thermal level during an active session.
|
THERMAL_EMERGENCY |
The device reached an emergency thermal level during an active session.
|
PEAK_POWER_SHUTDOWN |
The device's peak power reached shutdown level during an active session.
|
BATTERY_CRITICAL |
The device's battery is critically low during an active session.
|
DAT_APP_ON_THE_GLASSES_UPDATE_REQUIRED |
Your glasses need an update. Go to App Connections page in Meta AI to update.
|
DWA_UNAVAILABLE |
The DAT Wearables App on the glasses did not become reachable after session start. This typically means DWA failed to launch or is not installed on the device.
|
UNEXPECTED_ERROR |
An unexpected error occurred during the session.
|
description
: String
[Get] |
A human-readable description of the error suitable for logging and debugging purposes.
Signature
open override val description: String |
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 DeviceSessionError.description.
Returns String
The localized error description, or the default description if localization unavailable.
|