throw new InvalidAuthorizationException(FACEBOOK, message);
}
throw new NotAuthorizedException(FACEBOOK, message);
} else if (statusCode == HttpStatus.FORBIDDEN) {
if (message.contains("Requires extended permission")) {
throw new InsufficientPermissionException(FACEBOOK, message.split(": ")[1]);
} else if (message.contains("Permissions error")) {
throw new InsufficientPermissionException(FACEBOOK);
} else if (message.contains("The user hasn't authorized the application to perform this action")) {
throw new InsufficientPermissionException(FACEBOOK);
} else {
throw new OperationNotPermittedException(FACEBOOK, message);
}
} else if (statusCode == HttpStatus.NOT_FOUND) {
throw new ResourceNotFoundException(FACEBOOK, message);