# GenAiException


```
class GenAiException : Exception
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [com.google.mlkit.genai.common.GenAiException](https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/GenAiException) |

*** ** * ** ***

Represents an exception that occurs during service execution.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/annotation/IntDef.html(value = [https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.BUSY, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.CANCELLED, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.NEEDS_SYSTEM_UPDATE, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.NOT_AVAILABLE, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.NOT_ENOUGH_DISK_SPACE, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.NOT_SUPPORTED, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.REQUEST_PROCESSING_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.REQUEST_TOO_LARGE, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.RESPONSE_GENERATION_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.RESPONSE_PROCESSING_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.REQUEST_TOO_SMALL, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.AICORE_INCOMPATIBLE, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.INVALID_INPUT_IMAGE, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.PER_APP_BATTERY_USE_QUOTA_EXCEEDED, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.BACKGROUND_USE_BLOCKED, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.CACHE_PROCESSING_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.STRUCTURED_OUTPUT_REQUEST_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.STRUCTURED_OUTPUT_RESPONSE_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.STRUCTURED_OUTPUT_MAX_TOKENS_ERROR, https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/ErrorCode.AUDIO_BUFFER_OVERFLOW]) annotation https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/GenAiException.ErrorCode` The set of error codes. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `@https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/GenAiException.ErrorCode https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/GenAiException#errorCode()` |
| `https://developer.android.com/reference/java/time/Duration.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/GenAiException#retryDelay()` |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/add-suppressed.html(p: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/init-cause.html(p: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/set-stack-trace.html(p: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/to-string.html()` | |

## Public properties

### errorCode

```
@GenAiException.ErrorCode
val errorCode: Int
```

### retryDelay

```
val retryDelay: Duration
```