HttpDataSource.InvalidResponseCodeException


public final class HttpDataSource.InvalidResponseCodeException extends HttpDataSource.HttpDataSourceException


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

Summary

Public fields

final Map<StringList<String>>

An unmodifiable map of the response header fields and values.

final byte[]

The response body.

final int

The response code that was outside of the 2xx range.

final @Nullable String

The http status message.

Public constructors

@UnstableApi
InvalidResponseCodeException(
    int responseCode,
    @Nullable String responseMessage,
    @Nullable IOException cause,
    Map<StringList<String>> headerFields,
    DataSpec dataSpec,
    byte[] responseBody
)

Inherited Constants

From androidx.media3.datasource.DataSourceException
static final int

This field is deprecated.

Use ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.

From androidx.media3.datasource.HttpDataSource.HttpDataSourceException
static final int

The error occurred in closing a HttpDataSource.

static final int

The error occurred reading data from a HttpDataSource.

static final int

The error occurred in opening a HttpDataSource.

Inherited methods

From androidx.media3.datasource.DataSourceException
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.

From androidx.media3.datasource.HttpDataSource.HttpDataSourceException
static HttpDataSource.HttpDataSourceException

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

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] stackTrace)
String

Public fields

headerFields

@UnstableApi
public final Map<StringList<String>> headerFields

An unmodifiable map of the response header fields and values.

responseBody

public final byte[] responseBody

The response body.

responseCode

public final int responseCode

The response code that was outside of the 2xx range.

responseMessage

public final @Nullable String responseMessage

The http status message.

Public constructors

InvalidResponseCodeException

@UnstableApi
public InvalidResponseCodeException(
    int responseCode,
    @Nullable String responseMessage,
    @Nullable IOException cause,
    Map<StringList<String>> headerFields,
    DataSpec dataSpec,
    byte[] responseBody
)