ApolloHttpException

class ApolloHttpException(val statusCode: Int, val headers: List<HttpHeader>, val body: BufferedSource?, message: String, cause: Throwable? = null) : ApolloException

The response was received but the media type was application/json and the code was not 2xx. Note that application/graphql-response+json do not throw this exception.

See https://graphql.github.io/graphql-over-http/draft/.

Parameters

statusCode

the HTTP status code

headers

the HTTP headers

body

the HTTP error body. By default, body is always null. You can opt-in HttpNetworkTransport.httpExposeErrorBody if you need it. If you're doing this, you must call BufferedSource.close on body to avoid sockets and other resources leaking.

Constructors

Link copied to clipboard
constructor(statusCode: Int, headers: List<HttpHeader>, body: BufferedSource?, message: String, cause: Throwable? = null)

Properties

Link copied to clipboard
val body: BufferedSource?
Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
Link copied to clipboard
open val message: String?
Link copied to clipboard