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.
Parameters | |
---|---|
resultCode |
Int: One of the constants documented in AppSearchResult#getResultCode . Value is android.app.appsearch.AppSearchResult#RESULT_OK , android.app.appsearch.AppSearchResult#RESULT_UNKNOWN_ERROR , android.app.appsearch.AppSearchResult#RESULT_INTERNAL_ERROR , android.app.appsearch.AppSearchResult#RESULT_INVALID_ARGUMENT , android.app.appsearch.AppSearchResult#RESULT_IO_ERROR , android.app.appsearch.AppSearchResult#RESULT_OUT_OF_SPACE , android.app.appsearch.AppSearchResult#RESULT_NOT_FOUND , android.app.appsearch.AppSearchResult#RESULT_INVALID_SCHEMA , android.app.appsearch.AppSearchResult#RESULT_SECURITY_ERROR , android.app.appsearch.AppSearchResult.RESULT_DENIED, android.app.appsearch.AppSearchResult.RESULT_RATE_LIMITED, or android.app.appsearch.AppSearchResult.RESULT_TIMED_OUT |
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 android.app.appsearch.AppSearchResult#RESULT_OK , android.app.appsearch.AppSearchResult#RESULT_UNKNOWN_ERROR , android.app.appsearch.AppSearchResult#RESULT_INTERNAL_ERROR , android.app.appsearch.AppSearchResult#RESULT_INVALID_ARGUMENT , android.app.appsearch.AppSearchResult#RESULT_IO_ERROR , android.app.appsearch.AppSearchResult#RESULT_OUT_OF_SPACE , android.app.appsearch.AppSearchResult#RESULT_NOT_FOUND , android.app.appsearch.AppSearchResult#RESULT_INVALID_SCHEMA , android.app.appsearch.AppSearchResult#RESULT_SECURITY_ERROR , android.app.appsearch.AppSearchResult.RESULT_DENIED, android.app.appsearch.AppSearchResult.RESULT_RATE_LIMITED, or android.app.appsearch.AppSearchResult.RESULT_TIMED_OUT |
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.
Return | |
---|---|
Int |
One of the constants documented in AppSearchResult#getResultCode . Value is android.app.appsearch.AppSearchResult#RESULT_OK , android.app.appsearch.AppSearchResult#RESULT_UNKNOWN_ERROR , android.app.appsearch.AppSearchResult#RESULT_INTERNAL_ERROR , android.app.appsearch.AppSearchResult#RESULT_INVALID_ARGUMENT , android.app.appsearch.AppSearchResult#RESULT_IO_ERROR , android.app.appsearch.AppSearchResult#RESULT_OUT_OF_SPACE , android.app.appsearch.AppSearchResult#RESULT_NOT_FOUND , android.app.appsearch.AppSearchResult#RESULT_INVALID_SCHEMA , android.app.appsearch.AppSearchResult#RESULT_SECURITY_ERROR , android.app.appsearch.AppSearchResult.RESULT_DENIED, android.app.appsearch.AppSearchResult.RESULT_RATE_LIMITED, or android.app.appsearch.AppSearchResult.RESULT_TIMED_OUT |
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 . |