Package com.apollographql.apollo3.exception

Types

Link copied to clipboard
class ApolloCanceledException(message: String? = null, cause: Throwable? = null) : ApolloException
Link copied to clipboard
class ApolloCompositeException(first: Throwable?, second: Throwable?) : ApolloException

Multiple exceptions happened. This happens typically when a CacheFirst request fails to fetch both the cache and the network. In that case, ApolloCompositeException is thrown, and you can access the underlying cache and network exceptions in suppressedExceptions.

Link copied to clipboard
open class ApolloException(message: String? = null, cause: Throwable? = null) : RuntimeException

The base class for all exceptions

Link copied to clipboard
class ApolloGenericException(message: String? = null, cause: Throwable? = null) : ApolloException

Something went wrong but it's not sure exactly what

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

The response was received but the response code was not 200

Link copied to clipboard
class ApolloNetworkException(message: String? = null, val platformCause: Any? = null) : ApolloException

A network error happened: socket closed, DNS issue, TLS problem, etc...

Link copied to clipboard
class ApolloParseException(message: String? = null, cause: Throwable? = null) : ApolloException

The response could not be parsed either because of another issue than JsonDataException or JsonEncodingException

Link copied to clipboard
class ApolloWebSocketClosedException(    val code: Int,     val reason: String? = null,     cause: Throwable? = null) : ApolloException

A WebSocket connection could not be established: e.g., expired token

Link copied to clipboard
class AutoPersistedQueriesNotSupported : ApolloException
Link copied to clipboard
class CacheMissException constructor(    val key: String,     val fieldName: String? = null,     stale: Boolean = false) : ApolloException

An object/field was missing in the cache If fieldName is null, it means a reference to an object could not be resolved

Link copied to clipboard
class HttpCacheMissException(message: String, cause: Exception? = null) : ApolloException

A HTTP cache miss happened

Link copied to clipboard
class JsonDataException(message: String) : ApolloException

Thrown when the data in a JSON document doesn't match the data expected by the caller.

Link copied to clipboard
class JsonEncodingException(message: String) : ApolloException

Thrown when the data being parsed is not encoded as valid JSON.

Link copied to clipboard
class MissingValueException : ApolloException
Link copied to clipboard
class SubscriptionOperationException(operationName: String, val payload: Any? = null) : ApolloException

The server could not process a subscription and sent an error.

Properties

Link copied to clipboard
var apolloExceptionHandler: (Throwable) -> Unit

A handler that can be set to intercept certain exceptions occurring in the library that are not normally surfaced. This can be used to investigate issues. The default is to log the exception.

Link copied to clipboard
val ApolloNetworkException.nsError: NSError?