private void requestCompleted(Response response) {
    Request request = response.getRequest();
    if (request != currentRequest) {
      return;
    }

    loading = false;
    currentRequest = null;

    FacebookRequestError requestError = response.getError();
    FacebookException exception = (requestError == null) ? null : requestError.getException();
    if (response.getGraphObject() == null && exception == null) {
      exception =
          new FacebookException("GraphObjectPagingLoader received neither a result nor an error.");
    }

    if (exception != null) {
      nextRequest = null;

      if (onErrorListener != null) {
        onErrorListener.onError(exception, this);
      }
    } else {
      addResults(response);
    }
  }
Ejemplo n.º 2
0
 private void callOnErrorListener(Exception exception) {
   if (onErrorListener != null) {
     if (!(exception instanceof FacebookException)) {
       exception = new FacebookException(exception);
     }
     onErrorListener.onError(this, (FacebookException) exception);
   }
 }