# ConnectionsException

# ConnectionsException

*** ** * ** ***

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

<br />

```
@RequiresApi(value = 26) class ConnectionsException : 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.connections.ConnectionsException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException) |

*** ** * ** ***

Exception for connections 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[Participant.openConnection](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/Participant#openConnection(kotlin.String))or[Participant.acceptConnection](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/Participant#acceptConnection(kotlin.String))may fail with this exception.

## Summary

|                                                                                  ### Nested types                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [ConnectionsException.ConnectionsErrorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException.ConnectionsErrorCode) |   |

|                                                                                                                                                                                                                                                                                                                         ### Public constructors                                                                                                                                                                                                                                                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [ConnectionsException](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException#ConnectionsException(kotlin.Int,kotlin.String,kotlin.Throwable))`(` ` errorCode: @`[ConnectionsException.ConnectionsErrorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException.ConnectionsErrorCode)` `[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 @`[ConnectionsException.ConnectionsErrorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException.ConnectionsErrorCode)` `[Int](https://developer.android.com/reference/kotlin/kotlin/Int) | [errorCode](https://developer.android.com/reference/kotlin/com/google/ambient/crossdevice/connections/ConnectionsException#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

### ConnectionsException

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

## Public properties

### errorCode

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