Java 类com.facebook.FacebookGraphResponseException 实例源码

项目:ReactiveFB    文件:RequestAction.java   
@Override
public void onCompleted(GraphResponse response) {
    FacebookRequestError error = response.getError();
    if (error != null) {
        Logger.logError(RequestAction.class,
                "Failed to get what you have requested", error.getException());

        if (mSingleEmitter != null) {
            mSingleEmitter.onError(error.getException());
        }
    } else {
        if (response.getRawResponse() == null) {
            Logger.logError(RequestAction.class, "The response GraphObject " +
                    "has null value. Response=" + response.toString(), null);
            mSingleEmitter.onError(new FacebookGraphResponseException(response,
                    "The response has null value"));
        } else {
            if (mSingleEmitter != null) {
                mSingleEmitter.onSuccess(response);
            }
        }
    }
}
项目:kognitivo    文件:ShareInternalUtility.java   
static void invokeOnErrorCallback(
        FacebookCallback<Sharer.Result> callback,
        GraphResponse response,
        String message) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_ERROR, message);
    if (callback != null) {
        callback.onError(new FacebookGraphResponseException(response, message));
    }
}
项目:kognitivo    文件:VideoUploader.java   
protected void executeGraphRequestSynchronously(Bundle parameters) {
    GraphRequest request = new GraphRequest(
            uploadContext.accessToken,
            String.format(Locale.ROOT, "%s/videos", uploadContext.graphNode),
            parameters,
            HttpMethod.POST,
            null);
    GraphResponse response = request.executeAndWait();

    if (response != null) {
        FacebookRequestError error = response.getError();
        JSONObject responseJSON = response.getJSONObject();
        if (error != null) {
            if (!attemptRetry(error.getSubErrorCode())) {
                handleError(new FacebookGraphResponseException(response, ERROR_UPLOAD));
            }
        } else if (responseJSON != null) {
            try {
                handleSuccess(responseJSON);
            } catch (JSONException e) {
                endUploadWithFailure(new FacebookException(ERROR_BAD_SERVER_RESPONSE, e));
            }
        } else {
            handleError(new FacebookException(ERROR_BAD_SERVER_RESPONSE));
        }
    } else {
        handleError(new FacebookException(ERROR_BAD_SERVER_RESPONSE));
    }
}
项目:Move-Alarm_ORCA    文件:ShareInternalUtility.java   
private static void invokeOnErrorCallback(
        FacebookCallback<Sharer.Result> callback,
        GraphResponse response,
        String message) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_ERROR, message);
    if (callback != null) {
        callback.onError(new FacebookGraphResponseException(response, message));
    }
}
项目:SocioBlood    文件:ShareInternalUtility.java   
static void invokeOnErrorCallback(
        FacebookCallback<Sharer.Result> callback,
        GraphResponse response,
        String message) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_ERROR, message);
    if (callback != null) {
        callback.onError(new FacebookGraphResponseException(response, message));
    }
}
项目:SocioBlood    文件:VideoUploader.java   
protected void executeGraphRequestSynchronously(Bundle parameters) {
    GraphRequest request = new GraphRequest(
            uploadContext.accessToken,
            String.format(Locale.ROOT, "%s/videos", uploadContext.targetId),
            parameters,
            HttpMethod.POST,
            null);
    GraphResponse response = request.executeAndWait();

    if (response != null) {
        FacebookRequestError error = response.getError();
        JSONObject responseJSON = response.getJSONObject();
        if (error != null) {
            if (!attemptRetry(error.getSubErrorCode())) {
                handleError(new FacebookGraphResponseException(response, ERROR_UPLOAD));
            }
        } else if (responseJSON != null) {
            try {
                handleSuccess(responseJSON);
            } catch (JSONException e) {
                endUploadWithFailure(new FacebookException(ERROR_BAD_SERVER_RESPONSE, e));
            }
        } else {
            handleError(new FacebookException(ERROR_BAD_SERVER_RESPONSE));
        }
    } else {
        handleError(new FacebookException(ERROR_BAD_SERVER_RESPONSE));
    }
}