Failure

class Failure<out E : Any>(val error: E?, val throwable: Throwable? = null, val code: Int? = null, val errorType: ClerkResult.Failure.ErrorType = ErrorType.UNKNOWN, tags: Map<KClass<*>, Any> = emptyMap()) : ClerkResult<Nothing, E>

A unified failure type that contains all necessary error information.

Constructors

Link copied to clipboard
constructor(error: E?, throwable: Throwable? = null, code: Int? = null, errorType: ClerkResult.Failure.ErrorType = ErrorType.UNKNOWN, tags: Map<KClass<*>, Any> = emptyMap())

Types

Link copied to clipboard

Properties

Link copied to clipboard
val code: Int?
Link copied to clipboard
val error: E?
Link copied to clipboard

Convenience function to extract a user-facing error message from a ClerkResult.Failure.

Link copied to clipboard

Automatic credential flows start without user intent, so failures from the credential ceremony itself are logged instead of presented. Server rejections of a credential the user selected arrive as API failures and remain presentable.

Link copied to clipboard
val tags: Map<KClass<*>, Any>
Link copied to clipboard

Functions

Link copied to clipboard

Returns the encapsulated Throwable exception if this is a failure.

Link copied to clipboard

Convenience function to extract the first error message from a ClerkResult.Failure containing a ClerkErrorResponse. Returns null if the error is not a ClerkErrorResponse or if there are no error messages.

Link copied to clipboard