public static abstract @interface **GenAiException.ErrorCode** implements [Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation.html) The set of error codes.

### Constant Summary

|---|---|---|
| int | [AICORE_INCOMPATIBLE](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#AICORE_INCOMPATIBLE) | AICore is not installed or its version is too low. |
| int | [AUDIO_BUFFER_OVERFLOW](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#AUDIO_BUFFER_OVERFLOW) | Audio buffer overflow. |
| int | [BACKGROUND_USE_BLOCKED](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#BACKGROUND_USE_BLOCKED) | Background usage is blocked. |
| int | [BUSY](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#BUSY) | The service is currently busy. |
| int | [CACHE_PROCESSING_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#CACHE_PROCESSING_ERROR) | Error during cache processing for prompt prefix. |
| int | [CANCELLED](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#CANCELLED) | The request is cancelled. |
| int | [INVALID_INPUT_IMAGE](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#INVALID_INPUT_IMAGE) | Invalid input image. |
| int | [MAX_TURNS_EXCEEDED](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#MAX_TURNS_EXCEEDED) | Agent reached max turns limit without reaching a final response. |
| int | [NEEDS_SYSTEM_UPDATE](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NEEDS_SYSTEM_UPDATE) | Android version is too low. |
| int | [NOT_AVAILABLE](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NOT_AVAILABLE) | Feature is not available. |
| int | [NOT_ENOUGH_DISK_SPACE](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NOT_ENOUGH_DISK_SPACE) | Not enough storage. |
| int | [NOT_SUPPORTED](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NOT_SUPPORTED) | The functionality is not implemented nor supported by the inference engine. |
| int | [PER_APP_BATTERY_USE_QUOTA_EXCEEDED](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#PER_APP_BATTERY_USE_QUOTA_EXCEEDED) | A long-duration (for example per-day) quota for the calling app's uid has been exceeded. |
| int | [REQUEST_PROCESSING_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#REQUEST_PROCESSING_ERROR) | Request doesn't pass certain policy check. |
| int | [REQUEST_TOO_LARGE](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#REQUEST_TOO_LARGE) | Request is too large to be processed. |
| int | [REQUEST_TOO_SMALL](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#REQUEST_TOO_SMALL) | Request is too small to be processed. |
| int | [RESPONSE_GENERATION_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#RESPONSE_GENERATION_ERROR) | The model cannot generate a response due to request not passing certain policy check. |
| int | [RESPONSE_PROCESSING_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#RESPONSE_PROCESSING_ERROR) | Generated response doesn't pass certain policy check. |
| int | [STRUCTURED_OUTPUT_MAX_TOKENS_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#STRUCTURED_OUTPUT_MAX_TOKENS_ERROR) | Error during structured output response processing due to reaching max tokens limit. |
| int | [STRUCTURED_OUTPUT_REQUEST_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#STRUCTURED_OUTPUT_REQUEST_ERROR) | Error during structured output request generation. |
| int | [STRUCTURED_OUTPUT_RESPONSE_ERROR](https://developers.google.com/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#STRUCTURED_OUTPUT_RESPONSE_ERROR) | Error during structured output response processing. |

### Inherited Method Summary

From interface java.lang.annotation.Annotation

|---|---|
| abstract [Class](https://developer.android.com/reference/java/lang/Class.html)\<? extends [Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation.html)\> | annotationType() |
| abstract boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| abstract int | hashCode() |
| abstract [String](https://developer.android.com/reference/java/lang/String.html) | toString() |

## Constants

#### public static final int
**AICORE_INCOMPATIBLE**

AICore is not installed or its version is too low.
Constant Value: -101

#### public static final int
**AUDIO_BUFFER_OVERFLOW**

Audio buffer overflow. The audio input rate is too fast.
Constant Value: -107

#### public static final int
**BACKGROUND_USE_BLOCKED**

Background usage is blocked. Please use the API when your app is in the foreground
instead.
Constant Value: 30

#### public static final int
**BUSY**

The service is currently busy.

This is either because your app is out of usage quota (please retry with exponential
backoff) or the request is from disallowed background usage (please use the API when
your app is in the foreground instead).
Constant Value: 9

#### public static final int
**CACHE_PROCESSING_ERROR**

Error during cache processing for prompt prefix.
Constant Value: -103

#### public static final int
**CANCELLED**

The request is cancelled.
Constant Value: 7

#### public static final int
**INVALID_INPUT_IMAGE**

Invalid input image. It can be due to invalid image URL, failure to decode to
bitmap, invalid mime type or other image processing failures.
Constant Value: -102

#### public static final int
**MAX_TURNS_EXCEEDED**

Agent reached max turns limit without reaching a final response.
Constant Value: -112

#### public static final int
**NEEDS_SYSTEM_UPDATE**

Android version is too low.
Constant Value: 604

#### public static final int
**NOT_AVAILABLE**

Feature is not available.
Constant Value: 8

#### public static final int
**NOT_ENOUGH_DISK_SPACE**

Not enough storage.
Constant Value: 501

#### public static final int
**NOT_SUPPORTED**

The functionality is not implemented nor supported by the inference engine.
Constant Value: 16

#### public static final int
**PER_APP_BATTERY_USE_QUOTA_EXCEEDED**

A long-duration (for example per-day) quota for the calling app's uid has been
exceeded. Use of AICore from this app has been restricted to preserve battery.
Constant Value: 27

#### public static final int
**REQUEST_PROCESSING_ERROR**

Request doesn't pass certain policy check.
Constant Value: 4

#### public static final int
**REQUEST_TOO_LARGE**

Request is too large to be processed. Use a smaller input.
Constant Value: 12

#### public static final int
**REQUEST_TOO_SMALL**

Request is too small to be processed. Use a longer input.
Constant Value: -100

#### public static final int
**RESPONSE_GENERATION_ERROR**

The model cannot generate a response due to request not passing certain policy
check.

When using streaming mode with a supported API, this error may interrupt output
streaming, leading to an incomplete result. Consider removing the result entirely from
your app's UI when this occurs.
Constant Value: 15

#### public static final int
**RESPONSE_PROCESSING_ERROR**

Generated response doesn't pass certain policy check.

When using streaming mode with a supported API, this error may interrupt output
streaming, leading to an incomplete result. Consider removing the result entirely from
your app's UI when this occurs.
Constant Value: 11

#### public static final int
**STRUCTURED_OUTPUT_MAX_TOKENS_ERROR**

Error during structured output response processing due to reaching max tokens
limit.
Constant Value: -106

#### public static final int
**STRUCTURED_OUTPUT_REQUEST_ERROR**

Error during structured output request generation.
Constant Value: -104

#### public static final int
**STRUCTURED_OUTPUT_RESPONSE_ERROR**

Error during structured output response processing.
Constant Value: -105