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])
annotation GenAiException.ErrorCode


The set of error codes.

Summary

Constants

const Int

AICore is not installed or its version is too low.

const Int

Background usage is blocked.

const Int
BUSY = 9

The service is currently busy.

const Int

Error during cache processing for prompt prefix.

const Int

The request is cancelled.

const Int

Invalid input image.

const Int

Android version is too low.

const Int

Feature is not available.

const Int

Not enough storage.

const Int

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

const Int

Request doesn't pass certain policy check.

const Int

Request is too large to be processed.

const Int

Request is too small to be processed.

const Int

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

const Int

Generated response doesn't pass certain policy check.

Constants

AICORE_INCOMPATIBLE

const val AICORE_INCOMPATIBLE = -101: Int

AICore is not installed or its version is too low.

BACKGROUND_USE_BLOCKED

const val BACKGROUND_USE_BLOCKED = 30: Int

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

BUSY

const val BUSY = 9: Int

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

const val CACHE_PROCESSING_ERROR = -103: Int

Error during cache processing for prompt prefix.

CANCELLED

const val CANCELLED = 7: Int

The request is cancelled.

INVALID_INPUT_IMAGE

const val INVALID_INPUT_IMAGE = -102: Int

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

const val NEEDS_SYSTEM_UPDATE = 604: Int

Android version is too low.

NOT_AVAILABLE

const val NOT_AVAILABLE = 8: Int

Feature is not available.

NOT_ENOUGH_DISK_SPACE

const val NOT_ENOUGH_DISK_SPACE = 501: Int

Not enough storage.

PER_APP_BATTERY_USE_QUOTA_EXCEEDED

const val PER_APP_BATTERY_USE_QUOTA_EXCEEDED = 27: Int

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

const val REQUEST_PROCESSING_ERROR = 4: Int

Request doesn't pass certain policy check.

REQUEST_TOO_LARGE

const val REQUEST_TOO_LARGE = 12: Int

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

REQUEST_TOO_SMALL

const val REQUEST_TOO_SMALL = -100: Int

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

RESPONSE_GENERATION_ERROR

const val RESPONSE_GENERATION_ERROR = 15: Int

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

const val RESPONSE_PROCESSING_ERROR = 11: Int

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.