AppSearchException
open class AppSearchException : Exception
| kotlin.Any | |||
| ↳ | kotlin.Throwable | ||
| ↳ | java.lang.Exception | ||
| ↳ | android.app.appsearch.exceptions.AppSearchException | ||
An exception thrown by android.app.appsearch.AppSearchSession or a subcomponent.
These exceptions can be converted into a failed AppSearchResult for propagating to the client.
Summary
| Public constructors | |
|---|---|
AppSearchException(resultCode: Int)Initializes an |
|
AppSearchException(resultCode: Int, message: String?)Initializes an |
|
AppSearchException(resultCode: Int, message: String?, cause: Throwable?)Initializes an |
|
| Public methods | |
|---|---|
| open Int |
Returns the result code this exception was constructed with. |
| open AppSearchResult<T> |
Converts this |
Public constructors
AppSearchException
AppSearchException(resultCode: Int)
Initializes an AppSearchException with no message.
AppSearchException
AppSearchException(
resultCode: Int,
message: String?)
Initializes an AppSearchException with a result code and message.
| Parameters | |
|---|---|
resultCode |
Int: One of the constants documented in AppSearchResult.getResultCode. Value is one of the following:
|
message |
String?: The detail message (which is saved for later retrieval by the getMessage() method). This value may be null. |
AppSearchException
AppSearchException(
resultCode: Int,
message: String?,
cause: Throwable?)
Initializes an AppSearchException with a result code, message and cause.
Public methods
getResultCode
open fun getResultCode(): Int
Returns the result code this exception was constructed with.
toAppSearchResult
open fun <T : Any!> toAppSearchResult(): AppSearchResult<T>
Converts this java.lang.Exception into a failed AppSearchResult.
| Return | |
|---|---|
AppSearchResult<T> |
This value cannot be null. |