# CrossDeviceException

# CrossDeviceException

*** ** * ** ***

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

<br />

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

<br />

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

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

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

*** ** * ** ***

Base exception type for Cross device APIs.

## Summary

|                                                                                                            ### Public fields                                                                                                            ||
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract int`                                                     | [errorCode](https://developer.android.com/reference/com/google/ambient/crossdevice/CrossDeviceException#errorCode()) The error code associated with this exception. |
| [String](https://developer.android.com/reference/java/lang/String) | [message](https://developer.android.com/reference/com/google/ambient/crossdevice/CrossDeviceException#message())                                                    |

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

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

|                                                                                                                                                                                            ### Inherited fields                                                                                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| From class[kotlin.Throwable](https://developer.android.com/reference/kotlin/Throwable) |--------------------------------------------------------------------------|---------------------------------------------------------------------------| | [Throwable](https://developer.android.com/reference/java/lang/Throwable) | [cause](https://developer.android.com/reference/kotlin/Throwable#cause()) | |

## Public fields

### errorCode

```
public abstract int errorCode
```

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/com/google/ambient/crossdevice/connections/ConnectionsException) |   |
| [SessionException](https://developer.android.com/reference/com/google/ambient/crossdevice/sessions/SessionException)            |   |

### message

```
public String message
```

## Public constructors

### CrossDeviceException

```
public final CrossDeviceException(String message, Throwable cause)
```