code: protected Object parseCallResult(InputStream data, IFacebookMethod method)
      throws FacebookException, IOException {
      Object json = JSONValue.parse(new InputStreamReader(data));
      if (isDebug()) {
        log(method.methodName() + ": " + (null != json ? json.toString() : "null"));
      }
  
      if (json instanceof JSONObject) {
        JSONObject jsonObj = (JSONObject) json;
        if (jsonObj.containsKey("error_code")) {
          Long errorCode = (Long) jsonObj.get("error_code");
          String message = (String) jsonObj.get("error_msg");
          throw new FacebookException(errorCode.intValue(), message);
        }
      }
      return json;
    }
docs: Parses the result of an API call from JSON into Java Objects.
  @param data an InputStream with the results of a request to the Facebook servers
  @param method the method
  @return a Java Object
  @throws FacebookException if <code>data</code> represents an error
  @throws IOException if <code>data</code> is not readable
  @see JSONObject