AppSearchException
public class AppSearchException extends Exception
| java.lang.Object | |||
| ↳ | kotlin.Throwable | ||
| ↳ | java.lang.Exception | ||
| ↳ | androidx.appsearch.exceptions.AppSearchException |
An exception thrown by androidx.appsearch.app.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, @Nullable String message)Initializes an |
AppSearchException(Initializes an |
Public methods |
|
|---|---|
int |
Returns the result code this exception was constructed with. |
@NonNull AppSearchResult<T> |
<T> toAppSearchResult()Converts this |
Inherited methods |
|---|
Public constructors
AppSearchException
public AppSearchException(int resultCode)
Initializes an AppSearchException with no message.
| Parameters | |
|---|---|
int resultCode |
One of the constants documented in |
AppSearchException
public AppSearchException(int resultCode, @Nullable String message)
Initializes an AppSearchException with a result code and message.
| Parameters | |
|---|---|
int resultCode |
One of the constants documented in |
@Nullable String message |
The detail message (which is saved for later retrieval by the |
AppSearchException
public AppSearchException(
int resultCode,
@Nullable String message,
@Nullable Throwable cause
)
Initializes an AppSearchException with a result code, message and cause.
| Parameters | |
|---|---|
int resultCode |
One of the constants documented in |
@Nullable String message |
The detail message (which is saved for later retrieval by the |
@Nullable Throwable cause |
The cause (which is saved for later retrieval by the |
Public methods
getResultCode
public int getResultCode()
Returns the result code this exception was constructed with.
| Returns | |
|---|---|
int |
One of the constants documented in |
toAppSearchResult
public @NonNull AppSearchResult<T> <T> toAppSearchResult()
Converts this java.lang.Exception into a failed AppSearchResult.