DataSourceException


class DataSourceException : IOException

Known direct subclasses
AssetDataSource.AssetDataSourceException

Thrown when an IOException is encountered reading a local asset.

ContentDataSource.ContentDataSourceException

Thrown when an IOException is encountered reading from a content URI.

FileDataSource.FileDataSourceException

Thrown when a FileDataSource encounters an error reading a file.

HttpDataSource.HttpDataSourceException

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

RawResourceDataSource.RawResourceDataSourceException

Thrown when an IOException is encountered reading from a raw resource.

UdpDataSource.UdpDataSourceException

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

Known indirect 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.


Used to specify reason of a DataSource error.

Summary

Constants

const Int

This property is deprecated.

Use ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.

Public constructors

Constructs a DataSourceException.

Constructs a DataSourceException.

Constructs a DataSourceException.

@UnstableApi
DataSourceException(
    message: String?,
    cause: Throwable?,
    @PlaybackException.ErrorCode reason: Int
)

Constructs a DataSourceException.

Public functions

java-static Boolean

Returns whether the given IOException was caused by a DataSourceException whose reason is ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE in its cause stack.

Public properties

Int

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

Constants

POSITION_OUT_OF_RANGE

@UnstableApi
const val POSITION_OUT_OF_RANGE = 2008: Int

Indicates that the starting position of the request was outside the bounds of the data.

Public constructors

DataSourceException

@UnstableApi
DataSourceException(@PlaybackException.ErrorCode reason: Int)

Constructs a DataSourceException.

Parameters
@PlaybackException.ErrorCode reason: Int

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

DataSourceException

@UnstableApi
DataSourceException(
    cause: Throwable?,
    @PlaybackException.ErrorCode reason: Int
)

Constructs a DataSourceException.

Parameters
cause: Throwable?

The error cause.

@PlaybackException.ErrorCode reason: Int

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

DataSourceException

@UnstableApi
DataSourceException(
    message: String?,
    @PlaybackException.ErrorCode reason: Int
)

Constructs a DataSourceException.

Parameters
message: String?

The error message.

@PlaybackException.ErrorCode reason: Int

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

DataSourceException

@UnstableApi
DataSourceException(
    message: String?,
    cause: Throwable?,
    @PlaybackException.ErrorCode reason: Int
)

Constructs a DataSourceException.

Parameters
message: String?

The error message.

cause: Throwable?

The error cause.

@PlaybackException.ErrorCode reason: Int

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

Public functions

isCausedByPositionOutOfRange

@UnstableApi
java-static fun isCausedByPositionOutOfRange(e: IOException!): Boolean

Returns whether the given IOException was caused by a DataSourceException whose reason is ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE in its cause stack.

Public properties

reason

@PlaybackException.ErrorCode
val reasonInt

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