# LoaderErrorThrower

# LoaderErrorThrower

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/upstream/LoaderErrorThrower "View this page in Java")

<br />

```
@UnstableApi
interface LoaderErrorThrower
```

<br />

Known direct subclasses  
[LoaderErrorThrower.Placeholder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower.Placeholder),[Loader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader)  

|----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| [LoaderErrorThrower.Placeholder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower.Placeholder) | A[LoaderErrorThrower](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower)that never throws.    |
| [Loader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader)                                                 | Manages the background loading of[Loadable](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable)s. |

*** ** * ** ***

Conditionally throws errors affecting a[Loader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader).

## Summary

|                                                                                                                                                                                                            ### Nested types                                                                                                                                                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[LoaderErrorThrower.Placeholder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower.Placeholder)` : `[LoaderErrorThrower](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower) A[LoaderErrorThrower](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower)that never throws. |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [maybeThrowError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower#maybeThrowError())`()` Throws a fatal error, or a non-fatal error if loading is currently backed off and the current[Loadable](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable)has incurred a number of errors greater than the[Loader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader)s default minimum number of retries. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [maybeThrowError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoaderErrorThrower#maybeThrowError(int))`(minRetryCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Throws a fatal error, or a non-fatal error if loading is currently backed off and the current[Loadable](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable)has incurred a number of errors greater than the specified minimum number of retries.   |

## Public functions

### maybeThrowError

```
fun maybeThrowError(): Unit
```

Throws a fatal error, or a non-fatal error if loading is currently backed off and the current[Loadable](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable)has incurred a number of errors greater than the[Loader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader)s default minimum number of retries. Else does nothing.  

|                                         Throws                                          |
|-----------------------------------------------------------------------------------------|------------|
| [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) | The error. |

### maybeThrowError

```
fun maybeThrowError(minRetryCount: Int): Unit
```

Throws a fatal error, or a non-fatal error if loading is currently backed off and the current[Loadable](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable)has incurred a number of errors greater than the specified minimum number of retries. Else does nothing.  

|                                          Parameters                                          |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| `minRetryCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | A minimum retry count that must be exceeded for a non-fatal error to be thrown. Should be non-negative. |

|                                         Throws                                          |
|-----------------------------------------------------------------------------------------|------------|
| [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) | The error. |