# 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)

*** ** * ** ***


```
public interface ErrorMessageProvider<T extends Throwable>
```

<br />

*** ** * ** ***

Converts throwables into error codes and user readable error messages.

## Summary

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Integer.html, https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/ErrorMessageProvider#getErrorMessage(T)(T throwable)` Returns a pair consisting of an error code and a user readable error message for the given throwable. |

## Public methods

### getErrorMessage

```
abstract Pair<Integer, String> getErrorMessage(T throwable)
```

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/java/lang/Integer.html, https://developer.android.com/reference/java/lang/String.html>` | A pair consisting of an error code and a user readable error message. |