# UdpDataSource.UdpDataSourceException

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/UdpDataSource.java+class:androidx.media3.datasource.UdpDataSource.UdpDataSourceException)

*** ** * ** ***


```
class UdpDataSource.UdpDataSourceException : 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.UdpDataSource.UdpDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/UdpDataSource.UdpDataSourceException) |

*** ** * ** ***

Thrown when an error is encountered when trying to read from a `https://developer.android.com/reference/kotlin/androidx/media3/datasource/UdpDataSource`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/UdpDataSource.UdpDataSourceException#UdpDataSourceException(java.lang.Throwable,int)( cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.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 `UdpDataSourceException`. |

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

### UdpDataSourceException

```
UdpDataSourceException(
    cause: Throwable!,
    @PlaybackException.ErrorCode errorCode: Int
)
```

Creates a `UdpDataSourceException`.

| Parameters |
|---|---|
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | The error cause. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Reason of the error, should be one of the `ERROR_CODE_IO_*` in `https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode`. |