public class AppSearchException
extends Exception

   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ androidx.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 with no message.

AppSearchException(int resultCode, String message)

Initializes an AppSearchException with a result code and message.

AppSearchException(int resultCode, String message, Throwable cause)

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

Public methods

int getResultCode()

Returns the result code this exception was constructed with.

<T> AppSearchResult<T> toAppSearchResult()

Converts this Exception into a failed AppSearchResult.

Inherited methods