Package com.restfb.exception
Class FacebookException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.restfb.exception.FacebookException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FacebookErrorMessageException,FacebookJsonMappingException,FacebookLoggerException,FacebookNetworkException,FacebookPreconditionException,FacebookResponseContentException,FacebookSignedRequestParsingException,FacebookSignedRequestVerificationException
Root of the RestFB exception hierarchy.
- Author:
- Mark Allen, Norbert Bartels
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAggregates optional metadata that may help diagnose a failing Facebook request. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFacebookException(String message) Creates an exception with the given message.protectedFacebookException(String message, Throwable cause) Creates an exception with the given message and cause. -
Method Summary
Modifier and TypeMethodDescriptionRequest metadata associated with this exception, if available.withInfoData(FacebookException.InfoData infoData) Adds optional request metadata to the exception for diagnostics.withInfoData(String httpMethod, String fullEndpoint, String parameterString, String headerAccessToken, Long startTime) Convenience helper to attach request metadata.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FacebookException
Creates an exception with the given message.- Parameters:
message- A message describing this exception.
-
FacebookException
Creates an exception with the given message and cause.- Parameters:
message- A message describing this exception.cause- The exception that caused this exception to be thrown.
-
-
Method Details
-
withInfoData
Adds optional request metadata to the exception for diagnostics.- Parameters:
infoData- encapsulated request metadata (may benull)- Returns:
- this exception for fluent usage.
-
withInfoData
public FacebookException withInfoData(String httpMethod, String fullEndpoint, String parameterString, String headerAccessToken, Long startTime) Convenience helper to attach request metadata.- Returns:
- this exception for fluent usage.
-
getMessage
- Overrides:
getMessagein classThrowable
-
getBasicMessage
-
getInfoData
Request metadata associated with this exception, if available.- Returns:
- optional request metadata
-