> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Failure

> Kotlin Data Class

**Data Class**

```kotlin theme={null}
data class Failure<E>(val error: E) : Result<Nothing, E>
```

## Constructors

```kotlin theme={null}
constructor(error: E)
```

## Properties

### error

```kotlin theme={null}
val error: E
```

## Functions

### flatMap

```kotlin theme={null}
inline fun <T, E, R> Result<T, E>.flatMap(transform: (T) -> Result<R, E>): Result<R, E>
```

### fold

```kotlin theme={null}
inline fun <T, E> Result<T, E>.fold(onSuccess: (T) -> Unit, onFailure: (E) -> Unit)
```

### getOrNull

```kotlin theme={null}
fun <T, E> Result<T, E>.getOrNull(): T?
```

### getOrThrow

```kotlin theme={null}
fun <T, E> Result<T, E>.getOrThrow(): T
```

### map

```kotlin theme={null}
inline fun <T, E, R> Result<T, E>.map(transform: (T) -> R): Result<R, E>
```

### mapError

```kotlin theme={null}
inline fun <T, E, F> Result<T, E>.mapError(transform: (E) -> F): Result<T, F>
```
