Integer httpStatusCode, String type, String message) {
if ("OAuthException".equals(type) || "OAuthAccessTokenException".equals(type))
return new FacebookOAuthException(type, message, errorCode, errorSubcode, httpStatusCode);
if ("QueryParseException".equals(type))
return new FacebookQueryParseException(type, message, errorCode, errorSubcode, httpStatusCode);
// Don't recognize this exception type? Just go with the standard
// FacebookGraphException.
return new FacebookGraphException(type, message, errorCode, errorSubcode, httpStatusCode);
}