Package-level declarations

Types

Link copied to clipboard
@Serializable
open class ClientException(val message: String? = null, val cause: Throwable? = null, val httpStatusCode: Int? = null, val errorBody: ErrorBody? = null, val errorString: String? = null, val errorType: String? = null, val httpURl: String? = null, val code: String? = null, val failureCount: Int? = null) : Throwable

ClientException class wraps exception and throwable across the code base. We encourage to use this class when dealing with Http Error response or throwing exceptions .

Link copied to clipboard
@Serializable
data class ErrorBody(val code: String? = null, val message: String? = null)

A data class used to generate a proper Api Error body, by default, each API will return a code and message on failure.

Link copied to clipboard
@Serializable
data class ExpirableValue(val value: String, val exp: Long)

A value with expiration date in epoch second format

Link copied to clipboard
@Serializable
data class JwtPayload(val iss: String? = null, val exp: Long? = null, val iat: Long? = null, val sub: String? = null)

Functions

Link copied to clipboard

provides a safe casting of throwable converts any throwable into a ClientException. Clients don't need to perform casting as its handled on the SDK level.

Link copied to clipboard

function that takes a string as input and returns the ErrorBody of a given error message.

Link copied to clipboard
suspend fun Throwable.toClientException(failureCount: Int = 0): ClientException

provides a safe suspended casting of throwable converts any throwable into a ClientException. Clients don't need to perform casting as its handled on the SDK level.