Package-level declarations

Types

Link copied to clipboard
sealed class Failure : Throwable

This class allows to expose different kinds of error to be then handled by the application. As it is a sealed class, you typically use it like that : when(failure) { is NetworkConnection -> Unit is ServerError -> Unit is Unknown -> Unit }

Link copied to clipboard
sealed class GlobalError
Link copied to clipboard

This enum provide the reason why the SDK request an initial sync to the application.

Link copied to clipboard
@JsonClass(generateAdapter = true)
data class MatrixError(@Json(name = "errcode") val code: String, @Json(name = "error") val message: String, @Json(name = "consent_uri") val consentUri: String? = null, @Json(name = "limit_type") val limitType: String? = null, @Json(name = "admin_contact") val adminUri: String? = null, @Json(name = "retry_after_ms") val retryAfterMillis: Long? = null, @Json(name = "soft_logout") val isSoftLogout: Boolean? = null, @Json(name = "lookup_pepper") val newLookupPepper: String? = null, @Json(name = "session") val session: String? = null, @Json(name = "completed") val completedStages: List<String>? = null, @Json(name = "flows") val flows: List<InteractiveAuthenticationFlow>? = null, @Json(name = "params") val params: JsonDict? = null)

This data class holds the error defined by the matrix specifications. You shouldn't have to instantiate it. Ref: https://matrix.org/docs/spec/client_server/latest#api-standards

Link copied to clipboard

Functions

Link copied to clipboard
fun Throwable.getRetryDelay(defaultValue: Long): Long

Get the retry delay in case of rate limit exceeded error, adding 100 ms, of defaultValue otherwise.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Try to convert to a RegistrationFlowResponse. Return null in the cases it's not possible

Link copied to clipboard

Try to convert to a ScanFailure. Return null in the cases it's not possible