GenAiException.ErrorCode

@IntDef(value = [ErrorCode.BUSYErrorCode.CANCELLEDErrorCode.NEEDS_SYSTEM_UPDATEErrorCode.NOT_AVAILABLEErrorCode.NOT_ENOUGH_DISK_SPACEErrorCode.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_ERROR])
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

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

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.

Constants

AICORE_INCOMPATIBLE

public static final int AICORE_INCOMPATIBLE = -101

AICore is not installed or its version is too low.

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.

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.