# CrossDeviceException

# CrossDeviceException

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/com/google/ambient/crossdevice/CrossDeviceException "View this page in Java")

<br />

```
@RequiresApi(value = 26) abstract class CrossDeviceException : RuntimeException
```

<br />

|---|---|---|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://developer.android.com/reference/kotlin/kotlin/Any)                                                                                               |||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)                                                                                ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception)                                                                       |||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/kotlin/java/lang/RuntimeException)                                                      ||
|   |   |   | ↳ | [com.google.ambient.crossdevice.CrossDeviceException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/CrossDeviceException) |

Known direct subclasses  
[ConnectionsException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException),[SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)  

|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| [ConnectionsException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException) | Exception for connections requests. |
| [SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)            | Exception for session requests.     |

*** ** * ** ***

Base exception type for Cross device APIs.

## Summary

|                                                                                                                                                                     ### Public constructors                                                                                                                                                                      ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [CrossDeviceException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/CrossDeviceException#CrossDeviceException(kotlin.String,kotlin.Throwable))`(message: `[String](https://developer.android.com/reference/kotlin/kotlin/String)`?, cause: `[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)`?)` |

|                                                                                                                    ### Public properties                                                                                                                     ||
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract `[Int](https://developer.android.com/reference/kotlin/kotlin/Int)      | [errorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/CrossDeviceException#errorCode()) The error code associated with this exception. |
| `open `[String](https://developer.android.com/reference/kotlin/kotlin/String)`?` | [message](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/CrossDeviceException#message())                                                    |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| From class[kotlin.Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable) |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                                                                        | [addSuppressed](https://developer.android.com/reference/kotlin/kotlin/Throwable#addSuppressed(kotlin.Throwable))`(@`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` p0: `[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)`)`                                                                                        | | `open @`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` `[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)                                                                                              | [fillInStackTrace](https://developer.android.com/reference/kotlin/kotlin/Throwable#fillInStackTrace())`()`                                                                                                                                                                                                                                                                                             | | `open @`[RecentlyNullable](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNullable)` `[String](https://developer.android.com/reference/kotlin/kotlin/String)                                                                                                  | [getLocalizedMessage](https://developer.android.com/reference/kotlin/kotlin/Throwable#getLocalizedMessage())`()`                                                                                                                                                                                                                                                                                       | | `open @`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` `[Array](https://developer.android.com/reference/kotlin/kotlin/Array)`<`[StackTraceElement](https://developer.android.com/reference/kotlin/java/lang/StackTraceElement)`>` | [getStackTrace](https://developer.android.com/reference/kotlin/kotlin/Throwable#getStackTrace())`()`                                                                                                                                                                                                                                                                                                   | | `@`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` `[Array](https://developer.android.com/reference/kotlin/kotlin/Array)`<`[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)`>`                         | [getSuppressed](https://developer.android.com/reference/kotlin/kotlin/Throwable#getSuppressed())`()`                                                                                                                                                                                                                                                                                                   | | `open @`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` `[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)                                                                                              | [initCause](https://developer.android.com/reference/kotlin/kotlin/Throwable#initCause(kotlin.Throwable))`(@`[RecentlyNullable](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNullable)` p0: `[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)`)`                                                                                              | | `open `[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                                                                 | [printStackTrace](https://developer.android.com/reference/kotlin/kotlin/Throwable#printStackTrace())`()`                                                                                                                                                                                                                                                                                               | | `open `[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                                                                 | [printStackTrace](https://developer.android.com/reference/kotlin/kotlin/Throwable#printStackTrace(java.io.PrintStream))`(@`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` p0: `[PrintStream](https://developer.android.com/reference/kotlin/java/io/PrintStream)`)`                                                                            | | `open `[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                                                                 | [printStackTrace](https://developer.android.com/reference/kotlin/kotlin/Throwable#printStackTrace(java.io.PrintWriter))`(@`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` p0: `[PrintWriter](https://developer.android.com/reference/kotlin/java/io/PrintWriter)`)`                                                                            | | `open `[Unit](https://developer.android.com/reference/kotlin/kotlin/Unit)                                                                                                                                                                                                                 | [setStackTrace](https://developer.android.com/reference/kotlin/kotlin/Throwable#setStackTrace(kotlin.Array))`(@`[RecentlyNonNull](https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull)` p0: `[Array](https://developer.android.com/reference/kotlin/kotlin/Array)`<`[StackTraceElement](https://developer.android.com/reference/kotlin/java/lang/StackTraceElement)`>)` | |

|                                                                                                                                                                                                                   ### Inherited properties                                                                                                                                                                                                                   ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| From class[kotlin.Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable) |----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| | `open `[Throwable](https://developer.android.com/reference/kotlin/kotlin/Throwable)`?` | [cause](https://developer.android.com/reference/kotlin/kotlin/Throwable#cause()) | |

## Public constructors

### CrossDeviceException

```
CrossDeviceException(message: String? = null, cause: Throwable? = null)
```

## Public properties

### errorCode

```
abstract val errorCode: Int
```

The error code associated with this exception. Refer to the concrete implementations for the possible error codes and their meanings.  

|                                                                 See also                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------------------|---|
| [ConnectionsException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException) |   |
| [SessionException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException)            |   |

### message

```
open val message: String?
```