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? = null
Link copied to clipboard
val error: E?
Link copied to clipboard
Link copied to clipboard

Convenience function to extract the long error message from a ClerkResult.Failure.

Link copied to clipboard
val tags: Map<KClass<*>, Any>
Link copied to clipboard
val throwable: Throwable? = null

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