ApiError

sealed class ApiError : ErrorS1SDK

ApiError is a sealed interface that represents the different types of errors that can occur making a request to an API.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard

ExpiredToken when the request token is expired.

Link copied to clipboard
data class MissingDataOnResponse(val message: String) : ApiError

MissingDataOnResponse when the response doesn't return all the required data.

Link copied to clipboard

NotFound when the requested data was not found.

Link copied to clipboard

NotInternet when the device is not connected to internet.

Link copied to clipboard

Serialization when the response could not be serialized.

Link copied to clipboard
data class ServerError(val code: Int, val message: String? = null, val messages: List<String>? = null) : ApiError

ServerError when the server responded with an specific error domain.

Link copied to clipboard
object Timeout : ApiError

Timeout when the request timed out.

Link copied to clipboard

Unauthorized when the request requires user authentication.

Link copied to clipboard
data class Unknown(val cause: Throwable) : ApiError

Unknown when the server responded with an unknown error or the request failed for an unknown reason.