facebook4j
Class FacebookException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by facebook4j.FacebookException
All Implemented Interfaces:
java.io.Serializable

public class FacebookException
extends java.lang.Exception

An exception class that will be thrown when Facebook Graph API calls are failed.
In case the Facebook server returned HTTP error code, you can get the HTTP status code using getStatusCode() method.

Author:
Ryuji Yamashita - roundrop at gmail.com
See Also:
Serialized Form

Field Summary
private  int errorCode
           
private  java.lang.String errorMessage
           
private  java.lang.String errorType
           
private  HttpResponse response
           
private static long serialVersionUID
           
private  int statusCode
           
 
Constructor Summary
FacebookException(java.lang.String message)
           
FacebookException(java.lang.String message, HttpResponse res)
           
FacebookException(java.lang.String message, java.lang.Throwable cause)
           
FacebookException(java.lang.String message, java.lang.Throwable cause, int statusCode)
           
FacebookException(java.lang.Throwable cause)
           
 
Method Summary
private  void decode(java.lang.String str)
           
 boolean equals(java.lang.Object obj)
           
 int getErrorCode()
           
 java.lang.String getErrorMessage()
           
 java.lang.String getErrorType()
           
 java.lang.String getResponseHeader(java.lang.String name)
           
 int getStatusCode()
           
 int hashCode()
           
 boolean isCausedByNetworkIssue()
          Tests if the exception is caused by network issue
 boolean resourceNotFound()
          Tests if the exception is caused by non-existing resource
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

statusCode

private int statusCode

response

private HttpResponse response

errorType

private java.lang.String errorType

errorMessage

private java.lang.String errorMessage

errorCode

private int errorCode
Constructor Detail

FacebookException

public FacebookException(java.lang.String message,
                         java.lang.Throwable cause)

FacebookException

public FacebookException(java.lang.String message,
                         HttpResponse res)

FacebookException

public FacebookException(java.lang.String message)

FacebookException

public FacebookException(java.lang.Throwable cause)

FacebookException

public FacebookException(java.lang.String message,
                         java.lang.Throwable cause,
                         int statusCode)
Method Detail

decode

private void decode(java.lang.String str)

getErrorType

public java.lang.String getErrorType()

getErrorMessage

public java.lang.String getErrorMessage()

getErrorCode

public int getErrorCode()

getStatusCode

public int getStatusCode()

getResponseHeader

public java.lang.String getResponseHeader(java.lang.String name)

isCausedByNetworkIssue

public boolean isCausedByNetworkIssue()
Tests if the exception is caused by network issue

Returns:
if the exception is caused by network issue

resourceNotFound

public boolean resourceNotFound()
Tests if the exception is caused by non-existing resource

Returns:
if the exception is caused by non-existing resource

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable