# MediaSync.OnErrorListener

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# OnErrorListener

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/MediaSync.OnErrorListener "View this page in Java")  

```
interface OnErrorListener
```

|------------------------------------------------------------------------------------------------------------------------------------|
| [android.media.MediaSync.OnErrorListener](https://developer.android.com/reference/kotlin/android/media/MediaSync.OnErrorListener#) |

Interface definition of a callback to be invoked when there has been an error during an asynchronous operation (other errors will throw exceptions at method call time).

## Summary

|                                                                                                                                                                                                                                                                         Public methods                                                                                                                                                                                                                                                                          ||
|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](https://developer.android.com/reference/kotlin/android/media/MediaSync.OnErrorListener#onError(android.media.MediaSync,%20kotlin.Int,%20kotlin.Int))`(`sync:` `[MediaSync](https://developer.android.com/reference/kotlin/android/media/MediaSync)`, `what:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `extra:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called to indicate an error. |

## Public methods

### onError

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun onError(
    sync: MediaSync, 
    what: Int, 
    extra: Int
): Unit
```

Called to indicate an error.

|                                                                                                                                                                                                            Parameters                                                                                                                                                                                                            ||
|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sync`  | [MediaSync](https://developer.android.com/reference/kotlin/android/media/MediaSync):The MediaSync the error pertains to This value cannot be`null`.                                                                                                                                                                                                                                                                     |
| `what`  | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The type of error that has occurred: - [MEDIASYNC_ERROR_AUDIOTRACK_FAIL](https://developer.android.com/reference/kotlin/android/media/MediaSync#MEDIASYNC_ERROR_AUDIOTRACK_FAIL:kotlin.Int) - [MEDIASYNC_ERROR_SURFACE_FAIL](https://developer.android.com/reference/kotlin/android/media/MediaSync#MEDIASYNC_ERROR_SURFACE_FAIL:kotlin.Int) |
| `extra` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):an extra code, specific to the error. Typically implementation dependent.                                                                                                                                                                                                                                                                    |