# SessionException

# SessionException

*** ** * ** ***

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

<br />

```
@RequiresApi(value = 26) class SessionException : CrossDeviceException
```

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

*** ** * ** ***

Exception for session requests.[Result](https://developer.android.com/reference/kotlin/kotlin/Result)or[ListenableFuture](https://developer.android.com/reference/kotlin/com/google/common/util/concurrent/ListenableFuture)returned from APIs in[Sessions](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions)may fail with this exception.

## Summary

|                                                                         ### Nested types                                                                         ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [SessionException.SessionErrorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException.SessionErrorCode) |   |

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

|                                                                                                                                                                                                   ### Public properties                                                                                                                                                                                                   ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open @`[SessionException.SessionErrorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException.SessionErrorCode)` `[Int](https://developer.android.com/reference/kotlin/kotlin/Int) | [errorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException#errorCode()) The error code associated with this exception. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### 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[com.google.ambient.crossdevice.CrossDeviceException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/CrossDeviceException) |----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| | `open `[String](https://developer.android.com/reference/kotlin/kotlin/String)`?` | [message](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/CrossDeviceException#message()) | |
| 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

### SessionException

```
SessionException(
    errorCode: @SessionException.SessionErrorCode Int,
    message: String? = null,
    cause: Throwable? = null
)
```

## Public properties

### errorCode

```
open val errorCode: @SessionException.SessionErrorCode 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)            |   |