GenAiException.ErrorCode

public static abstract @interface GenAiException.ErrorCode implements Annotation

The set of error codes.

Constant Summary

int BUSY The service is currently busy.
int CANCELLED Inference cancelled.
int NEEDS_SYSTEM_UPDATE Android version is outdated.
int NOT_AVAILABLE Feature is not available.
int NOT_ENOUGH_DISK_SPACE Not enough storage.
int REQUEST_PROCESSING_ERROR Request doesn't pass certain policy check.
int REQUEST_TOO_LARGE Request is too large to be processed.
int REQUEST_TOO_SMALL Request is too small to be processed.
int RESPONSE_GENERATION_ERROR The model failed to generate a proper response.
int RESPONSE_PROCESSING_ERROR Generated response doesn't pass certain policy check.

Inherited Method Summary

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

Inference cancelled.

Constant Value: 7

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

Not enough storage.

Constant Value: 501

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