Package 

Class FacebookRequestError

  • All Implemented Interfaces:
    android.os.Parcelable

    
    public final class FacebookRequestError
     implements Parcelable
                        

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

    In general, one would call .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/](https://developers.facebook.com/docs/reference/api/errors/)

    • Method Detail

      • getCategory

         final FacebookRequestError.Category 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).

      • getErrorRecoveryMessage

         final String getErrorRecoveryMessage()

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

      • getErrorType

         final String getErrorType()

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

      • getErrorUserTitle

         final String 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.

      • getErrorUserMessage

         final String 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.

      • getRequestResult

         final JSONObject 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).

      • getBatchRequestResult

         final Object 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 .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.