# ListenableFutureExtensionKt

Added in 1.0.0

*** ** * ** ***

<br />

```
public final class ListenableFutureExtensionKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/health/services/client/ListenableFutureExtensionKt#(com.google.common.util.concurrent.ListenableFuture).awaitWithException()( @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> receiver )` Extension function on ListenableFuture performs `https://developer.android.com/reference/androidx/concurrent/futures/package-summary#(com.google.common.util.concurrent.ListenableFuture).await()` operation and if any exception thrown by the asynchronous API, converts `https://developer.android.com/reference/android/os/RemoteException.html` into `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` |

## Public methods

### awaitWithException

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/ListenableFutureExtension.kt+function:awaitWithException)

```
public static final @NonNull T <T extends Object> awaitWithException(
    @NonNull ListenableFuture<@NonNull T> receiver
)
```

Extension function on ListenableFuture performs `https://developer.android.com/reference/androidx/concurrent/futures/package-summary#(com.google.common.util.concurrent.ListenableFuture).await()` operation and if any exception thrown by the asynchronous API, converts `https://developer.android.com/reference/android/os/RemoteException.html` into `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException`

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/health/services/client/HealthServicesException` | if remote operation fails |