# WatchFacePushManager.SetWatchFaceAsActiveException

Artifact: [androidx.wear.watchfacepush:watchfacepush](https://developer.android.com/jetpack/androidx/releases/wear-watchfacepush) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchfacepush/WatchFacePush.kt+class:androidx.wear.watchfacepush.WatchFacePushManager.SetWatchFaceAsActiveException) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchfacepush#1.0.0)

*** ** * ** ***

<br />

```
class WatchFacePushManager.SetWatchFaceAsActiveException : Exception
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [androidx.wear.watchfacepush.WatchFacePushManager.SetWatchFaceAsActiveException](https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException) |

*** ** * ** ***

An exception that can be thrown by `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager#setWatchFaceAsActive(kotlin.String)`

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#ERROR_INVALID_SLOT_ID()` The slot ID provided is not valid. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#ERROR_MAXIMUM_ATTEMPTS_REACHED()` The maximum number of attempts to set the watch face as active has been reached. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#ERROR_MISSING_PERMISSION() = 1000` The required permission to set the watch face as active is missing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#ERROR_UNKNOWN()` Unknown error while setting a watch face as active. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#SetWatchFaceAsActiveException(kotlin.Int,kotlin.Throwable)(errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, rootCause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#errorCode()` The specific subtype of error occurred. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException#message()` |

### Inherited functions

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html(s: https://developer.android.com/reference/java/io/PrintStream.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html(s: https://developer.android.com/reference/java/io/PrintWriter.html)`

### Inherited properties

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/cause.html` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/localized-message.html` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html>` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/stack-trace.html` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html>` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/suppressed.html`

## Constants

### ERROR_INVALID_SLOT_ID

```
const val ERROR_INVALID_SLOT_ID: Int
```

The slot ID provided is not valid. The watch face might have been removed previously, or the ID is simply incorrect. Make sure to retrieve slot IDs by calling `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager#listWatchFaces()` or `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager#addWatchFace(android.os.ParcelFileDescriptor,kotlin.String)`.

### ERROR_MAXIMUM_ATTEMPTS_REACHED

```
const val ERROR_MAXIMUM_ATTEMPTS_REACHED: Int
```

The maximum number of attempts to set the watch face as active has been reached.

### ERROR_MISSING_PERMISSION

```
const val ERROR_MISSING_PERMISSION = 1000: Int
```

The required permission to set the watch face as active is missing.

### ERROR_UNKNOWN

```
const val ERROR_UNKNOWN: Int
```

Unknown error while setting a watch face as active. Typically this means that the Watch Face Push service on the watch could not be accessed or that the watch may be in a bad state.

## Public constructors

### SetWatchFaceAsActiveException

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchfacepush#1.0.0)

```
SetWatchFaceAsActiveException(errorCode: Int, rootCause: Throwable? = null)
```

| Parameters |
|---|---|
| `errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The specific subtype of error occurred. See `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException.Companion.ErrorCode` for the possible values. |
| `rootCause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html? = null` | The exception that caused the problem in the first place. |

## Public properties

### errorCode

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchfacepush#1.0.0)

```
val errorCode: Int
```

The specific subtype of error occurred. See `https://developer.android.com/reference/kotlin/androidx/wear/watchfacepush/WatchFacePushManager.SetWatchFaceAsActiveException.Companion.ErrorCode` for the possible values.

### message

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