Added in API level 31

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 with no message.

AppSearchException(resultCode: Int, message: String?)

Initializes an AppSearchException with a result code and message.

AppSearchException(resultCode: Int, message: String?, cause: Throwable?)

Initializes an AppSearchException with a result code, message and cause.

Public methods
open Int

Returns the result code this exception was constructed with.

open AppSearchResult<T>

Converts this java.lang.Exception into a failed AppSearchResult.

Public constructors

Public methods

toAppSearchResult

Added in API level 31
open fun <T : Any!> toAppSearchResult(): AppSearchResult<T>

Converts this java.lang.Exception into a failed AppSearchResult.

Return
AppSearchResult<T> This value cannot be null.