# ContentDataSource.ContentDataSourceException

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

*** ** * ** ***


```
class ContentDataSource.ContentDataSourceException : DataSourceException
```

<br />

|---|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) |||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||||
|   |   | ↳ | [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) |||
|   |   |   | ↳ | [androidx.media3.datasource.DataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException) ||
|   |   |   |   | ↳ | [androidx.media3.datasource.ContentDataSource.ContentDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/ContentDataSource.ContentDataSourceException) |

*** ** * ** ***

Thrown when an `https://developer.android.com/reference/java/io/IOException.html` is encountered reading from a content URI.

## Summary

| ### Public constructors |
|---|
| `[ContentDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/ContentDataSource.ContentDataSourceException#ContentDataSourceException(java.io.IOException))(cause: https://developer.android.com/reference/java/io/IOException.html!)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/datasource/ContentDataSource.ContentDataSourceException#ContentDataSourceException(java.io.IOException,int)`. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/ContentDataSource.ContentDataSourceException#ContentDataSourceException(java.io.IOException,int)( cause: https://developer.android.com/reference/java/io/IOException.html?, @https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a new instance. |

| ### Inherited Constants |
|---|
| From [androidx.media3.datasource.DataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException#POSITION_OUT_OF_RANGE() = 2008` **This property is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException#ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE()`. <br /> | |

| ### Inherited functions |
|---|
| From [androidx.media3.datasource.DataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException) |---|---| | `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException#isCausedByPositionOutOfRange(java.io.IOException)(e: https://developer.android.com/reference/java/io/IOException.html!)` Returns whether the given `https://developer.android.com/reference/java/io/IOException.html` was caused by a `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException` whose `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException#reason()` is `https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException#ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE()` in its cause stack. | |
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/to-string.html()` | |

| ### Inherited properties |
|---|
| From [androidx.media3.datasource.DataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException#reason()` The reason of this `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSourceException`, should be one of the `ERROR_CODE_IO_*` in `https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode`. | |

## Public constructors

### ContentDataSourceException

```
[ContentDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/ContentDataSource.ContentDataSourceException#ContentDataSourceException(java.io.IOException))(cause: IOException!)
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/datasource/ContentDataSource.ContentDataSourceException#ContentDataSourceException(java.io.IOException,int)`.

### ContentDataSourceException

```
ContentDataSourceException(
    cause: IOException?,
    @PlaybackException.ErrorCode errorCode: Int
)
```

Creates a new instance.