HttpDataSource.HttpDataSourceException


class HttpDataSource.HttpDataSourceException : DataSourceException

Known direct subclasses
CronetDataSource.OpenException

Thrown when an error is encountered when trying to open a CronetDataSource.

HttpDataSource.CleartextNotPermittedException

Thrown when cleartext HTTP traffic is not permitted.

HttpDataSource.InvalidContentTypeException

Thrown when the content type is invalid.

HttpDataSource.InvalidResponseCodeException

Thrown when an attempt to open a connection results in a response code not in the 2xx range.

HttpEngineDataSource.OpenException

Thrown when an error is encountered when trying to open a HttpEngineDataSource.


Thrown when an error is encountered when trying to read from a HttpDataSource.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation HttpDataSource.HttpDataSourceException.Type

The type of operation that produced the error.

Constants

const Int

The error occurred in closing a HttpDataSource.

const Int

The error occurred reading data from a HttpDataSource.

const Int

The error occurred in opening a HttpDataSource.

Public constructors

This function is deprecated.

Use HttpDataSourceException(DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

This function is deprecated.

Use HttpDataSourceException(IOException, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

Constructs an HttpDataSourceException.

This function is deprecated.

Use HttpDataSourceException(String, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

Constructs an HttpDataSourceException.

@UnstableApi
HttpDataSourceException(
    message: String!,
    cause: IOException!,
    dataSpec: DataSpec!,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

This function is deprecated.

Use HttpDataSourceException(String, IOException, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

@UnstableApi
HttpDataSourceException(
    message: String!,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

Constructs an HttpDataSourceException.

@UnstableApi
HttpDataSourceException(
    message: String!,
    cause: IOException?,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

Constructs an HttpDataSourceException.

Public functions

java-static HttpDataSource.HttpDataSourceException!

Returns a HttpDataSourceException whose error code is assigned according to the cause and type.

Public properties

DataSpec!

The DataSpec associated with the current connection.

Int

Inherited properties

From androidx.media3.datasource.DataSourceException
Int

The reason of this DataSourceException, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.

Constants

TYPE_CLOSE

const val TYPE_CLOSE = 3: Int

The error occurred in closing a HttpDataSource.

TYPE_OPEN

const val TYPE_OPEN = 1: Int

The error occurred reading data from a HttpDataSource.

TYPE_READ

const val TYPE_READ = 2: Int

The error occurred in opening a HttpDataSource.

Public constructors

HttpDataSourceException

@UnstableApi
HttpDataSourceException(
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

Constructs an HttpDataSourceException.

Parameters
dataSpec: DataSpec!

The DataSpec.

@PlaybackException.ErrorCode errorCode: Int

Reason of the error, should be one of the ERROR_CODE_IO_* in .

@HttpDataSource.HttpDataSourceException.Type type: Int

See Type.

HttpDataSourceException

@UnstableApi
HttpDataSourceException(
    cause: IOException!,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

Constructs an HttpDataSourceException.

Parameters
cause: IOException!

The error cause.

dataSpec: DataSpec!

The DataSpec.

@PlaybackException.ErrorCode errorCode: Int

Reason of the error, should be one of the ERROR_CODE_IO_* in .

@HttpDataSource.HttpDataSourceException.Type type: Int

See Type.

HttpDataSourceException

@UnstableApi
HttpDataSourceException(
    message: String!,
    cause: IOException!,
    dataSpec: DataSpec!,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

HttpDataSourceException

@UnstableApi
HttpDataSourceException(
    message: String!,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

Constructs an HttpDataSourceException.

Parameters
message: String!

The error message.

dataSpec: DataSpec!

The DataSpec.

@PlaybackException.ErrorCode errorCode: Int

Reason of the error, should be one of the ERROR_CODE_IO_* in .

@HttpDataSource.HttpDataSourceException.Type type: Int

See Type.

HttpDataSourceException

@UnstableApi
HttpDataSourceException(
    message: String!,
    cause: IOException?,
    dataSpec: DataSpec!,
    @PlaybackException.ErrorCode errorCode: Int,
    @HttpDataSource.HttpDataSourceException.Type type: Int
)

Constructs an HttpDataSourceException.

Parameters
message: String!

The error message.

cause: IOException?

The error cause.

dataSpec: DataSpec!

The DataSpec.

@PlaybackException.ErrorCode errorCode: Int

Reason of the error, should be one of the ERROR_CODE_IO_* in .

@HttpDataSource.HttpDataSourceException.Type type: Int

See Type.

Public functions

createForIOException

@UnstableApi
java-static fun createForIOException(
    cause: IOException!,
    dataSpec: DataSpec!,
    @HttpDataSource.HttpDataSourceException.Type type: Int
): HttpDataSource.HttpDataSourceException!

Returns a HttpDataSourceException whose error code is assigned according to the cause and type.

Public properties

dataSpec

@UnstableApi
val dataSpecDataSpec!

The DataSpec associated with the current connection.