Package com.restfb.exception
Class FacebookResponseStatusException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.restfb.exception.FacebookException
-
- com.restfb.exception.FacebookErrorMessageException
-
- com.restfb.exception.FacebookResponseStatusException
-
- All Implemented Interfaces:
Serializable
public class FacebookResponseStatusException extends FacebookErrorMessageException
Indicates that the Legacy REST Facebook endpoint returned JSON which indicates an error condition.This exception may also be thrown when executing certain operations against the Graph API, e.g. FQL queries or Batch API calls.
Example:
{"error_code": 2, "error_msg": "The service is not available at this time.", ...}
.- Author:
- Mark Allen
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FacebookResponseStatusException(Integer errorCode, String errorMessage, JsonObject rawError)
Creates an exception with the given message and error code.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getErrorCode()
Gets the Facebook API error code.String
getErrorMessage()
Gets the Facebook API error message.-
Methods inherited from class com.restfb.exception.FacebookErrorMessageException
getDebugHeaderInfo, getRawErrorJson, setDebugHeaderInfo, setRawErrorJson
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
FacebookResponseStatusException
public FacebookResponseStatusException(Integer errorCode, String errorMessage, JsonObject rawError)
Creates an exception with the given message and error code.- Parameters:
errorCode
- Value of the Facebook response attributeerror_code
.errorMessage
- Value of the Facebook response attributeerror_msg
.
-
-
Method Detail
-
getErrorCode
public Integer getErrorCode()
Gets the Facebook API error code.- Returns:
- The Facebook API error code.
-
getErrorMessage
public String getErrorMessage()
Gets the Facebook API error message.- Returns:
- The Facebook API error message.
-
-