HttpDataSource.InvalidResponseCodeException


class HttpDataSource.InvalidResponseCodeException : HttpDataSource.HttpDataSourceException


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

Summary

Public constructors

@UnstableApi
InvalidResponseCodeException(
    responseCode: Int,
    responseMessage: String?,
    cause: IOException?,
    headerFields: (Mutable)Map<String!, (Mutable)List<String!>!>!,
    dataSpec: DataSpec!,
    responseBody: ByteArray!
)

Public properties

(Mutable)Map<String!, (Mutable)List<String!>!>!

An unmodifiable map of the response header fields and values.

ByteArray<Byte>!

The response body.

Int

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

String?

The http status message.

Inherited Constants

const Int

This property is deprecated.

Use ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.

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.

Inherited 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.

java-static HttpDataSource.HttpDataSourceException!

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

Public constructors

InvalidResponseCodeException

@UnstableApi
InvalidResponseCodeException(
    responseCode: Int,
    responseMessage: String?,
    cause: IOException?,
    headerFields: (Mutable)Map<String!, (Mutable)List<String!>!>!,
    dataSpec: DataSpec!,
    responseBody: ByteArray!
)

Public properties

headerFields

@UnstableApi
val headerFields: (Mutable)Map<String!, (Mutable)List<String!>!>!

An unmodifiable map of the response header fields and values.

responseBody

val responseBodyByteArray<Byte>!

The response body.

responseCode

val responseCodeInt

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

responseMessage

val responseMessageString?

The http status message.