An exception thrown by AppSearchClient
or a subcomponent.
These exceptions can be converted into a failed AppSearchResult
for propagating to the client.
Public Constructor Summary
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 Method Summary
int |
getResultCode()
Returns the result code this exception was constructed with.
|
<T> AppSearchResult<T> |
toAppSearchResult()
Converts this
Exception
into a failed AppSearchResult .
|
Inherited Method Summary
Public Constructors
public AppSearchException (int resultCode)
Initializes an
AppSearchException
with no message.
Parameters
resultCode | One of the constants documented in
AppSearchResult.getResultCode() . |
---|
public AppSearchException (int resultCode, String message)
Initializes an
AppSearchException
with a result code and message.
Parameters
resultCode | One of the constants documented in
AppSearchResult.getResultCode() . |
---|---|
message | The detail message (which is saved for later retrieval by the Throwable.getMessage()
method). |
public AppSearchException (int resultCode, String message, Throwable cause)
Initializes an
AppSearchException
with a result code, message and cause.
Parameters
resultCode | One of the constants documented in
AppSearchResult.getResultCode() . |
---|---|
message | The detail message (which is saved for later retrieval by the Throwable.getMessage()
method). |
cause | 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.) |
Public Methods
public int getResultCode ()
Returns the result code this exception was constructed with.
Returns
- One of the constants documented in
AppSearchResult.getResultCode()
.
public AppSearchResult<T> toAppSearchResult ()
Converts this Exception
into
a failed AppSearchResult
.