5.4. RequestError¶
Request error class
Method
Name
Contents
Gets the message about the error that occurred during asynchronous execution.
Gets the exception that occurred during the asynchronous execution. (For debugging)
5.4.1. getMessage¶
Gets the message about the error that occurred during asynchronous execution.
Declaration
public String getMessage();
Parameter
None
Return value
Contents Type Message about the error that occurred during asynchronous execution. String Examples
private final RequestCallback mAllReceiptsCallback = new RequestCallback() { @Override public void onRequestResult(int statusCode, RequestError error) { String message; if (error != null) { message = error.getMessage(); } else { message = "Status Code : " + statusCode; } Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show(); } };
Refer to AllReceiptsFragment.java and AllReceiptsExtFragment.java.
5.4.2. getInternalException¶
Gets the exception that occurred during the asynchronous execution. (For debugging)
Declaration
public Exception getInternalException();
Parameter
None
Return value
Contents Type Exception that occurred during the asynchronous execution Exception Examples
private final RequestCallback mAllReceiptsCallback = new RequestCallback() { @Override public void onRequestResult(int statusCode, RequestError error) { String message; if (error != null) { message = error.getMessage(); Exception exception = error.getInternalException(); if (exception != null) { message = exception.getMessage(); } else { message = "Status Code : " + statusCode; } Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show(); } };
Refer to AllReceiptsFragment.java and AllReceiptsExtFragment.java.