AppSearchException
public class AppSearchException
extends Exception
| java.lang.Object | |||
| ↳ | java.lang.Throwable | ||
| ↳ | java.lang.Exception | ||
| ↳ | android.app.appsearch.exceptions.AppSearchException | ||
An exception thrown by AppSearchSession or a subcomponent.
These exceptions can be converted into a failed AppSearchResult for propagating to the client.
Summary
Public constructors | |
|---|---|
AppSearchException(int resultCode) Initializes an | |
AppSearchException(int resultCode, String message) Initializes an | |
AppSearchException(int resultCode, String message, Throwable cause) Initializes an | |
Public methods | |
|---|---|
int | getResultCode() Returns the result code this exception was constructed with. |
<T> AppSearchResult<T> | toAppSearchResult() Converts this |
Inherited methods | |
|---|---|
Public constructors
AppSearchException
public AppSearchException (int resultCode)
Initializes an AppSearchException with no message.
| Parameters | |
|---|---|
resultCode | int: One of the constants documented in AppSearchResult.getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, AppSearchResult.RESULT_SECURITY_ERROR, AppSearchResult.RESULT_DENIED, AppSearchResult.RESULT_RATE_LIMITED, AppSearchResult.RESULT_ALREADY_EXISTS, android.app.appsearch.AppSearchResult.RESULT_ABORTED, or android.app.appsearch.AppSearchResult.RESULT_UNAVAILABLE |
AppSearchException
public AppSearchException (int resultCode, String message)
Initializes an AppSearchException with a result code and message.
| Parameters | |
|---|---|
resultCode | int: One of the constants documented in AppSearchResult.getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, AppSearchResult.RESULT_SECURITY_ERROR, AppSearchResult.RESULT_DENIED, AppSearchResult.RESULT_RATE_LIMITED, AppSearchResult.RESULT_ALREADY_EXISTS, android.app.appsearch.AppSearchResult.RESULT_ABORTED, or android.app.appsearch.AppSearchResult.RESULT_UNAVAILABLE |
message | String: The detail message (which is saved for later retrieval by the Throwable.getMessage() method). This value may be null. |
AppSearchException
public AppSearchException (int resultCode, String message, Throwable cause)
Initializes an AppSearchException with a result code, message and cause.
| Parameters | |
|---|---|
resultCode | int: One of the constants documented in AppSearchResult.getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, AppSearchResult.RESULT_SECURITY_ERROR, AppSearchResult.RESULT_DENIED, AppSearchResult.RESULT_RATE_LIMITED, AppSearchResult.RESULT_ALREADY_EXISTS, android.app.appsearch.AppSearchResult.RESULT_ABORTED, or android.app.appsearch.AppSearchResult.RESULT_UNAVAILABLE |
message | String: The detail message (which is saved for later retrieval by the Throwable.getMessage() method). This value may be null. |
cause | Throwable: The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) |
Public methods
getResultCode
public int getResultCode ()
Returns the result code this exception was constructed with.
| Returns | |
|---|---|
int | One of the constants documented in AppSearchResult.getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, AppSearchResult.RESULT_SECURITY_ERROR, AppSearchResult.RESULT_DENIED, AppSearchResult.RESULT_RATE_LIMITED, AppSearchResult.RESULT_ALREADY_EXISTS, android.app.appsearch.AppSearchResult.RESULT_ABORTED, or android.app.appsearch.AppSearchResult.RESULT_UNAVAILABLE |
toAppSearchResult
public AppSearchResult<T> toAppSearchResult ()
Converts this Exception into a failed AppSearchResult.
| Returns | |
|---|---|
AppSearchResult<T> | This value cannot be null. |