# HttpEngineDataSource.OpenException

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

*** ** * ** ***


```
@UnstableApi
class HttpEngineDataSource.OpenException : HttpDataSource.HttpDataSourceException
```

<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.HttpDataSource.HttpDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException) ||
|   |   |   |   |   | ↳ | [androidx.media3.datasource.HttpEngineDataSource.OpenException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpEngineDataSource.OpenException) |

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpEngineDataSource.OpenException#OpenException(androidx.media3.datasource.DataSpec,int,int)( dataSpec: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec!, @https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, httpEngineConnectionStatus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpEngineDataSource.OpenException#OpenException(java.io.IOException,androidx.media3.datasource.DataSpec,int,int)( cause: https://developer.android.com/reference/java/io/IOException.html!, dataSpec: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec!, @https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, httpEngineConnectionStatus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpEngineDataSource.OpenException#OpenException(java.lang.String,androidx.media3.datasource.DataSpec,int,int)( errorMessage: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, dataSpec: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec!, @https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException.ErrorCode errorCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, httpEngineConnectionStatus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpEngineDataSource.OpenException#httpEngineConnectionStatus()` Returns the status of the connection establishment at the moment when the error occurred, as defined by `https://developer.android.com/reference/android/net/http/UrlRequest.Status.html`. |

| ### 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 /> | |
| From [androidx.media3.datasource.HttpDataSource.HttpDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException) |---|---| | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException#TYPE_CLOSE() = 3` The error occurred in closing a `HttpDataSource`. | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException#TYPE_OPEN() = 1` The error occurred reading data from a `HttpDataSource`. | | `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException#TYPE_READ() = 2` The error occurred in opening a `HttpDataSource`. | |

| ### 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 [androidx.media3.datasource.HttpDataSource.HttpDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException) |---|---| | `java-static https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException#createForIOException(java.io.IOException,androidx.media3.datasource.DataSpec,int)( cause: https://developer.android.com/reference/java/io/IOException.html!, dataSpec: https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec!, @https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException.Type type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns a `HttpDataSourceException` whose error code is assigned according to the cause and type. | |
| 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`. | |
| From [androidx.media3.datasource.HttpDataSource.HttpDataSourceException](https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException) |---|---| | `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException#dataSpec()` The `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec` associated with the current connection. | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException.Type https://developer.android.com/reference/kotlin/androidx/media3/datasource/HttpDataSource.HttpDataSourceException#type()` | |

## Public constructors

### OpenException

```
OpenException(
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    httpEngineConnectionStatus: Int
)
```

### OpenException

```
OpenException(
    cause: IOException!,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    httpEngineConnectionStatus: Int
)
```

### OpenException

```
OpenException(
    errorMessage: String!,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    httpEngineConnectionStatus: Int
)
```

## Public properties

### httpEngineConnectionStatus

```
val httpEngineConnectionStatus: Int
```

Returns the status of the connection establishment at the moment when the error occurred, as defined by `https://developer.android.com/reference/android/net/http/UrlRequest.Status.html`.