# Print output for @column tags ?>
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.
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 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 , or AppSearchResult.RESULT_SECURITY_ERROR |
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 , or AppSearchResult.RESULT_SECURITY_ERROR |
message |
String : The detail message (which is saved for later retrieval by the Throwable.getMessage() method).
This value may be null . |
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 , or AppSearchResult.RESULT_SECURITY_ERROR |
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.)
This value may be null . |
public int getResultCode ()
Returns the result code this exception was constructed with.
public AppSearchResult<T> toAppSearchResult ()
Converts this Exception
into a failed AppSearchResult
.
Returns | |
---|---|
AppSearchResult<T> |
This value cannot be null . |