retrofit / retrofit2 / HttpException

HttpException

open class HttpException : RuntimeException

Exception for an unexpected, non-2xx HTTP response.

Constructors

<init>

HttpException(response: Response<*>!)

Functions

code

open fun code(): Int

HTTP status code.

message

open fun message(): String!

HTTP status message.

response

open fun response(): Response<*>?

The full HTTP response. This may be null if the exception was serialized.