FacebookRequestError

This class represents an error that occurred during a Facebook request.

In general, one would call FacebookRequestError.getCategory() to determine the type of error that occurred, and act accordingly. For more information on error handling, see https://developers.facebook.com/docs/reference/api/errors/

Extends:Object
Implements:Parcelable
Package:facebook
Constructors
FacebookRequestError(int, String, String)
public FacebookRequestError(int errorCode, String errorType, String errorMessage)
ParameterDescription
errorCode
errorType
errorMessage
Instance Methods
getCategory()

Returns the category in which the error belongs. Applications can use the category to determine how best to handle the errors (e.g. exponential backoff for retries if being throttled).

public Category getCategory()
Returns
The category in which the error belong
getRequestStatusCode()

Returns the HTTP status code for this particular request.

public int getRequestStatusCode()
Returns
The HTTP status code for the request
getErrorCode()

Returns the error code returned from Facebook.

public int getErrorCode()
Returns
The error code returned from Facebook
getSubErrorCode()

Returns the sub-error code returned from Facebook.

public int getSubErrorCode()
Returns
The sub-error code returned from Facebook
getErrorType()

Returns the type of error as a raw string. This is generally less useful than using the FacebookRequestError.getCategory() method, but can provide further details on the error.

public String getErrorType()
Returns
The type of error as a raw string
getErrorMessage()

Returns the error message returned from Facebook.

public String getErrorMessage()
Returns
The error message returned from Facebook
getErrorRecoveryMessage()

Returns the message that can be displayed to the user before attempting error recovery.

public String getErrorRecoveryMessage()
Returns
The message that can be displayed to the user before attempting error recovery
getErrorUserMessage()

Returns a message suitable for display to the user, describing a user action necessary to enable Facebook functionality. Not all Facebook errors yield a message suitable for user display; however in all cases where shouldNotifyUser() returns true, this method returns a non-null message suitable for display.

public String getErrorUserMessage()
Returns
The error message returned from Facebook
getErrorUserTitle()

Returns a short summary of the error suitable for display to the user. Not all Facebook errors yield a title/message suitable for user display; however in all cases where getErrorUserTitle() returns valid String - user should be notified.

public String getErrorUserTitle()
Returns
The error message returned from Facebook
getRequestResultBody()

Returns the body portion of the response corresponding to the request from Facebook.

public JSONObject getRequestResultBody()
Returns
The body of the response for the request
getRequestResult()

Returns the full JSON response for the corresponding request. In a non-batch request, this would be the raw response in the form of a JSON object. In a batch request, this result will contain the body of the response as well as the HTTP headers that pertain to the specific request (in the form of a "headers" JSONArray).

public JSONObject getRequestResult()
Returns
The full JSON response for the request
getBatchRequestResult()

Returns the full JSON response for the batch request. If the request was not a batch request, then the result from this method is the same as FacebookRequestError.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 Object getBatchRequestResult()
Returns
The full JSON response for the batch
getConnection()

Returns the HTTP connection that was used to make the request.

public HttpURLConnection getConnection()
Returns
The HTTP connection used to make the request
getException()

Returns the exception associated with this request, if any.

public FacebookException getException()
Returns
The exception associated with this request
writeToParcel(Parcel, int)

Flatten this object in to a Parcel.

public void writeToParcel(Parcel dest, int flags)
ParameterDescription
destThe Parcel in which the object should be written.
flagsAdditional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
writeToParcel(Parcel, int)
public void writeToParcel(Parcel out, int flags)
ParameterDescription
out
flags
describeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

public int describeContents()
Returns
A bitmask indicating the set of special object types marshalled by the Parcelable.
describeContents()
public int describeContents()
Constants
INVALID_ERROR_CODE
Represents an invalid or unknown error code from the server.
public static final int INVALID_ERROR_CODE
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. Check the exception from FacebookRequestError.getException();
public static final int INVALID_HTTP_STATUS_CODE
CREATOR
public static final Creator CREATOR