# Print output for @column tags ?> AppSearchException - Android SDK | Android Developers

Most visited


Recently visited


AppSearchException

public class AppSearchException
extends Exception

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ android.app.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.

Summary


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

Public constructors


AppSearchException

public AppSearchException (int resultCode)

Initializes an AppSearchException with no message.

Parameters
resultCode int: One of the constants documented in AppSearchResult#getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, or AppSearchResult.RESULT_SECURITY_ERROR

AppSearchException

public AppSearchException (int resultCode, 
                String message)

Initializes an AppSearchException with a result code and message.

Parameters
resultCode int: One of the constants documented in AppSearchResult#getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, or AppSearchResult.RESULT_SECURITY_ERROR

message String: The detail message (which is saved for later retrieval by the Throwable.getMessage() method). This value may be null.

AppSearchException

public AppSearchException (int resultCode, 
                String message, 
                Throwable cause)

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

Parameters
resultCode int: One of the constants documented in AppSearchResult#getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, or AppSearchResult.RESULT_SECURITY_ERROR

message String: The detail message (which is saved for later retrieval by the Throwable.getMessage() method). This value may be null.

cause Throwable: The cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.) This value may be null.

Public methods


getResultCode

public int getResultCode ()

Returns the result code this exception was constructed with.

Returns
int One of the constants documented in AppSearchResult#getResultCode. Value is AppSearchResult.RESULT_OK, AppSearchResult.RESULT_UNKNOWN_ERROR, AppSearchResult.RESULT_INTERNAL_ERROR, AppSearchResult.RESULT_INVALID_ARGUMENT, AppSearchResult.RESULT_IO_ERROR, AppSearchResult.RESULT_OUT_OF_SPACE, AppSearchResult.RESULT_NOT_FOUND, AppSearchResult.RESULT_INVALID_SCHEMA, or AppSearchResult.RESULT_SECURITY_ERROR

toAppSearchResult

public AppSearchResult<T> toAppSearchResult ()

Converts this Exception into a failed AppSearchResult.

Returns
AppSearchResult<T> This value cannot be null.

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.