# ErrorMessageProvider

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/ErrorMessageProvider.java+class:androidx.media3.common.ErrorMessageProvider)

*** ** * ** ***


```
interface ErrorMessageProvider<T : Throwable?>
```

<br />

Known direct subclasses [DefaultErrorMessageProvider](https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/text/DefaultErrorMessageProvider)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/material3/text/DefaultErrorMessageProvider` |   |

*** ** * ** ***

Converts throwables into error codes and user readable error messages.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/util/Pair.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/ErrorMessageProvider#getErrorMessage(T)(throwable: T!)` Returns a pair consisting of an error code and a user readable error message for the given throwable. |

## Public functions

### getErrorMessage

```
fun getErrorMessage(throwable: T!): Pair<Int!, String!>!
```

Returns a pair consisting of an error code and a user readable error message for the given throwable.

| Parameters |
|---|---|
| `throwable: T!` | The throwable for which an error code and message should be generated. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/util/Pair.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | A pair consisting of an error code and a user readable error message. |