|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.facebook.FacebookRequestError
public final class FacebookRequestError
This class represents an error that occurred during a Facebook request.
In general, one would callgetCategory()
to determine the type
of error that occurred, and act accordingly. The app can also call
getUserActionMessageId()
in order to get the resource id for a
string that can be displayed to the user. For more information on error
handling, see
https://developers.facebook.com/docs/reference/api/errors/
Nested Class Summary | |
---|---|
static class |
FacebookRequestError.Category
An enum that represents the Facebook SDK classification for the error that occurred. |
Field Summary | |
---|---|
static int |
INVALID_ERROR_CODE
Represents an invalid or unknown error code from the server. |
static int |
INVALID_HTTP_STATUS_CODE
Indicates that there was no valid HTTP status code returned, indicating that either the error occurred locally, before the request was sent, or that something went wrong with the HTTP connection. |
Constructor Summary | |
---|---|
FacebookRequestError(int errorCode,
String errorType,
String errorMessage)
|
Method Summary | |
---|---|
Object |
getBatchRequestResult()
Returns the full JSON response for the batch request. |
FacebookRequestError.Category |
getCategory()
Returns the category in which the error belongs. |
HttpURLConnection |
getConnection()
Returns the HTTP connection that was used to make the request. |
int |
getErrorCode()
Returns the error code returned from Facebook. |
String |
getErrorMessage()
Returns the error message returned from Facebook. |
String |
getErrorType()
Returns the type of error as a raw string. |
FacebookException |
getException()
Returns the exception associated with this request, if any. |
JSONObject |
getRequestResult()
Returns the full JSON response for the corresponding request. |
JSONObject |
getRequestResultBody()
Returns the body portion of the response corresponding to the request from Facebook. |
int |
getRequestStatusCode()
Returns the HTTP status code for this particular request. |
int |
getSubErrorCode()
Returns the sub-error code returned from Facebook. |
int |
getUserActionMessageId()
Returns the resource id for a user-friendly message for the application to present to the user. |
boolean |
shouldNotifyUser()
Returns whether direct user action is required to successfully continue with the Facebook operation. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INVALID_ERROR_CODE
public static final int INVALID_HTTP_STATUS_CODE
getException()
;
Constructor Detail |
---|
public FacebookRequestError(int errorCode, String errorType, String errorMessage)
Method Detail |
---|
public int getUserActionMessageId()
public boolean shouldNotifyUser()
getUserActionMessageId()
in order to get a resource id for a message to show the user.
public FacebookRequestError.Category getCategory()
public int getRequestStatusCode()
public int getErrorCode()
public int getSubErrorCode()
public String getErrorType()
getCategory()
method, but can provide further details
on the error.
public String getErrorMessage()
public JSONObject getRequestResultBody()
public JSONObject getRequestResult()
public Object getBatchRequestResult()
getRequestResult()
.
In case of a batch request, the result will be a JSONArray where the elements
correspond to the requests in the batch. Callers should check the return type against
either JSONObject or JSONArray and cast accordingly.
public HttpURLConnection getConnection()
public FacebookException getException()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |