# AuthUserChangedException


```
open class AuthUserChangedException : DataConnectException
```

<br />

|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/kotlin/java/lang/Exception.html) |||
|   |   | ↳ | [com.google.firebase.dataconnect.DataConnectException](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/DataConnectException) ||
|   |   |   | ↳ | [com.google.firebase.dataconnect.AuthUserChangedException](https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/AuthUserChangedException) |

*** ** * ** ***

Thrown when a realtime streaming connection fails because the Firebase Auth user changed.

The SDK will throw this exception if the active Firebase Auth user is changed, either by a new user logging in or a logged-in user logging out while a realtime subscription flow is active.

To automatically reconnect under the new auth credentials, the `retryWhen` operator can be used:

```kotlin
import kotlinx.coroutines.flow.retryWhen

querySubscription
 .flow
 .retryWhen { cause, _ -> cause is AuthUserChangedException }
 .collect { println(it) }
```

## Summary

| ### Public constructors |
|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/dataconnect/AuthUserChangedException#AuthUserChangedException(kotlin.String,kotlin.Throwable)(message: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, cause: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html?)` |

### Inherited functions

From [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/add-suppressed.html(@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html p0: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/fill-in-stack-trace.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNullable.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-localized-message.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/java/lang/StackTraceElement.html>` `@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-stack-trace.html()` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html>` `@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-suppressed.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/init-cause.html(@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNullable.html p0: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html()` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html(@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html p0: https://developer.android.com/reference/kotlin/java/io/PrintStream.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html(@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html p0: https://developer.android.com/reference/kotlin/java/io/PrintWriter.html)` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/set-stack-trace.html(@https://developer.android.com/reference/kotlin/androidx/annotation/RecentlyNonNull.html p0: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/java/lang/StackTraceElement.html>)`

### Inherited properties

From [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html?` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/cause.html` `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/message.html`

## Public constructors

### AuthUserChangedException

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