GenAiException.ErrorCode

@IntDef(value = [ErrorCode.BUSYErrorCode.CANCELLEDErrorCode.NEEDS_SYSTEM_UPDATEErrorCode.NOT_AVAILABLEErrorCode.NOT_ENOUGH_DISK_SPACEErrorCode.NOT_SUPPORTEDErrorCode.REQUEST_PROCESSING_ERRORErrorCode.REQUEST_TOO_LARGEErrorCode.RESPONSE_GENERATION_ERRORErrorCode.RESPONSE_PROCESSING_ERRORErrorCode.REQUEST_TOO_SMALLErrorCode.AICORE_INCOMPATIBLEErrorCode.INVALID_INPUT_IMAGEErrorCode.PER_APP_BATTERY_USE_QUOTA_EXCEEDEDErrorCode.BACKGROUND_USE_BLOCKEDErrorCode.CACHE_PROCESSING_ERRORErrorCode.STRUCTURED_OUTPUT_REQUEST_ERRORErrorCode.STRUCTURED_OUTPUT_RESPONSE_ERRORErrorCode.STRUCTURED_OUTPUT_MAX_TOKENS_ERRORErrorCode.AUDIO_BUFFER_OVERFLOW])
public annotation GenAiException.ErrorCode


The set of error codes.

Summary

Constants

static final int

AICore is not installed or its version is too low.

static final int

Audio buffer overflow.

static final int

Background usage is blocked.

static final int
BUSY = 9

The service is currently busy.

static final int

Error during cache processing for prompt prefix.

static final int

The request is cancelled.

static final int

Invalid input image.

static final int

Android version is too low.

static final int

Feature is not available.

static final int

Not enough storage.

static final int

The functionality is not implemented nor supported by the inference engine.

static final int

A long-duration (for example per-day) quota for the calling app's uid has been exceeded.

static final int

Request doesn't pass certain policy check.

static final int

Request is too large to be processed.

static final int

Request is too small to be processed.

static final int

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

static final int

Generated response doesn't pass certain policy check.

static final int

Error during structured output response processing due to reaching max tokens limit.

static final int

Error during structured output request generation.

static final int

Error during structured output response processing.

Constants

AICORE_INCOMPATIBLE

public static final int AICORE_INCOMPATIBLE = -101

AICore is not installed or its version is too low.

AUDIO_BUFFER_OVERFLOW

public static final int AUDIO_BUFFER_OVERFLOW = -107

Audio buffer overflow. The audio input rate is too fast.

BACKGROUND_USE_BLOCKED

public static final int BACKGROUND_USE_BLOCKED = 30

Background usage is blocked. Please use the API when your app is in the foreground instead.

BUSY

public static final int BUSY = 9

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).

CACHE_PROCESSING_ERROR

public static final int CACHE_PROCESSING_ERROR = -103

Error during cache processing for prompt prefix.

CANCELLED

public static final int CANCELLED = 7

The request is cancelled.

INVALID_INPUT_IMAGE

public static final int INVALID_INPUT_IMAGE = -102

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

NEEDS_SYSTEM_UPDATE

public static final int NEEDS_SYSTEM_UPDATE = 604

Android version is too low.

NOT_AVAILABLE

public static final int NOT_AVAILABLE = 8

Feature is not available.

NOT_ENOUGH_DISK_SPACE

public static final int NOT_ENOUGH_DISK_SPACE = 501

Not enough storage.

NOT_SUPPORTED

public static final int NOT_SUPPORTED = 16

The functionality is not implemented nor supported by the inference engine.

PER_APP_BATTERY_USE_QUOTA_EXCEEDED

public static final int PER_APP_BATTERY_USE_QUOTA_EXCEEDED = 27

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.

REQUEST_PROCESSING_ERROR

public static final int REQUEST_PROCESSING_ERROR = 4

Request doesn't pass certain policy check.

REQUEST_TOO_LARGE

public static final int REQUEST_TOO_LARGE = 12

Request is too large to be processed. Use a smaller input.

REQUEST_TOO_SMALL

public static final int REQUEST_TOO_SMALL = -100

Request is too small to be processed. Use a longer input.

RESPONSE_GENERATION_ERROR

public static final int RESPONSE_GENERATION_ERROR = 15

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.

RESPONSE_PROCESSING_ERROR

public static final int RESPONSE_PROCESSING_ERROR = 11

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.

STRUCTURED_OUTPUT_MAX_TOKENS_ERROR

public static final int STRUCTURED_OUTPUT_MAX_TOKENS_ERROR = -106

Error during structured output response processing due to reaching max tokens limit.

STRUCTURED_OUTPUT_REQUEST_ERROR

public static final int STRUCTURED_OUTPUT_REQUEST_ERROR = -104

Error during structured output request generation.

STRUCTURED_OUTPUT_RESPONSE_ERROR

public static final int STRUCTURED_OUTPUT_RESPONSE_ERROR = -105

Error during structured output response processing.