GenAiException.ErrorCode
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From interface java.lang.annotation.Annotation
abstract Class<? extends Annotation>
|
annotationType()
|
abstract boolean |
|
abstract int |
hashCode()
|
abstract String
|
toString()
|
Constants
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
CANCELLED
public static final int
NEEDS_SYSTEM_UPDATE
Android version is outdated.
Constant Value: 604
public static final int
NOT_AVAILABLE
Feature is not available.
Constant Value: 8
public static final int
NOT_ENOUGH_DISK_SPACE
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.
Constant Value: 12
public static final int
REQUEST_TOO_SMALL
Request is too small to be processed.
Constant Value: -100
public static final int
RESPONSE_GENERATION_ERROR
The model failed to generate a proper response.
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-14 UTC.
[null,null,["Last updated 2025-05-14 UTC."],[],[],null,["# GenAiException.ErrorCode\n\npublic static abstract @interface **GenAiException.ErrorCode** implements [Annotation](//developer.android.com/reference/java/lang/annotation/Annotation.html) \nThe set of error codes. \n\n### Constant Summary\n\n|-----|----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|\n| int | [BUSY](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#BUSY) | The service is currently busy. |\n| int | [CANCELLED](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#CANCELLED) | Inference cancelled. |\n| int | [NEEDS_SYSTEM_UPDATE](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NEEDS_SYSTEM_UPDATE) | Android version is outdated. |\n| int | [NOT_AVAILABLE](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NOT_AVAILABLE) | Feature is not available. |\n| int | [NOT_ENOUGH_DISK_SPACE](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#NOT_ENOUGH_DISK_SPACE) | Not enough storage. |\n| int | [REQUEST_PROCESSING_ERROR](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#REQUEST_PROCESSING_ERROR) | Request doesn't pass certain policy check. |\n| int | [REQUEST_TOO_LARGE](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#REQUEST_TOO_LARGE) | Request is too large to be processed. |\n| int | [REQUEST_TOO_SMALL](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#REQUEST_TOO_SMALL) | Request is too small to be processed. |\n| int | [RESPONSE_GENERATION_ERROR](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#RESPONSE_GENERATION_ERROR) | The model failed to generate a proper response. |\n| int | [RESPONSE_PROCESSING_ERROR](/android/reference/com/google/mlkit/genai/common/GenAiException.ErrorCode#RESPONSE_PROCESSING_ERROR) | Generated response doesn't pass certain policy check. |\n\n### Inherited Method Summary\n\nFrom interface java.lang.annotation.Annotation \n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| abstract [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c? extends [Annotation](//developer.android.com/reference/java/lang/annotation/Annotation.html)\\\u003e | annotationType() |\n| abstract boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| abstract int | hashCode() |\n| abstract [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n\nConstants\n---------\n\n#### public static final int\n**BUSY**\n\nThe service is currently busy.\n\nThis is either because your app is out of usage quota (please retry with exponential\nbackoff) or the request is from disallowed background usage (please use the API when\nyour app is in the foreground instead). \nConstant Value: 9 \n\n#### public static final int\n**CANCELLED**\n\nInference cancelled. \nConstant Value: 7 \n\n#### public static final int\n**NEEDS_SYSTEM_UPDATE**\n\nAndroid version is outdated. \nConstant Value: 604 \n\n#### public static final int\n**NOT_AVAILABLE**\n\nFeature is not available. \nConstant Value: 8 \n\n#### public static final int\n**NOT_ENOUGH_DISK_SPACE**\n\nNot enough storage. \nConstant Value: 501 \n\n#### public static final int\n**REQUEST_PROCESSING_ERROR**\n\nRequest doesn't pass certain policy check. \nConstant Value: 4 \n\n#### public static final int\n**REQUEST_TOO_LARGE**\n\nRequest is too large to be processed. \nConstant Value: 12 \n\n#### public static final int\n**REQUEST_TOO_SMALL**\n\nRequest is too small to be processed. \nConstant Value: -100 \n\n#### public static final int\n**RESPONSE_GENERATION_ERROR**\n\nThe model failed to generate a proper response.\n\nWhen using streaming mode with a supported API, this error may interrupt output\nstreaming, leading to an incomplete result. Consider removing the result entirely from\nyour app's UI when this occurs. \nConstant Value: 15 \n\n#### public static final int\n**RESPONSE_PROCESSING_ERROR**\n\nGenerated response doesn't pass certain policy check.\n\nWhen using streaming mode with a supported API, this error may interrupt output\nstreaming, leading to an incomplete result. Consider removing the result entirely from\nyour app's UI when this occurs. \nConstant Value: 11"]]