views:

20

answers:

0

Hello,

I am trying to set status msgs for users from my application. While doing that I get the following exception for random users in my list.

PHP Fatal error: Uncaught exception 'FacebookRestClientException' with message 'An unknown error occurred' in /public/facebookapi_php5_restlib.php:3065 Stack trace:

#0 /public/facebookapi_php5_restlib.php(1813): FacebookRestClient->call_method('facebook.users....', Array)
#1 /public/status.php(105): FacebookRestClient->users_setStatus('I like coffee', '<SOMEUSERID>')
#2 {main}

thrown in /public/facebookapi_php5_restlib.php on line 3065

I checked in the facebook lib for the line, it corresponds to this function:

  3041    /* UTILITY FUNCTIONS */
  3042
  3043    /**
  3044     * Calls the specified normal POST method with the specified parameters.
  3045     *
  3046     * @param string $method  Name of the Facebook method to invoke
  3047     * @param array $params   A map of param names => param values
  3048     *
  3049     * @return mixed  Result of method call; this returns a reference to support
  3050     *                'delayed returns' when in a batch context.
  3051     *     See: http://wiki.developers.facebook.com/index.php/Using_batching_API
  3052     */
  3053    public function &call_method($method, $params = array()) {
  3054      if ($this->format) {
  3055        $params['format'] = $this->format;
  3056      }
  3057      if (!$this->pending_batch()) {
  3058        if ($this->call_as_apikey) {
  3059          $params['call_as_apikey'] = $this->call_as_apikey;
  3060        }
  3061        $data = $this->post_request($method, $params);
  3062        $this->rawData = $data;
  3063        $result = $this->convert_result($data, $method, $params);
  3064        if (is_array($result) && isset($result['error_code'])) {
  3065          throw new FacebookRestClientException($result['error_msg'],
  3066                                                $result['error_code']);
  3067        }
  3068      }
  3069      else {
  3070        $result = null;
  3071        $batch_item = array('m' => $method, 'p' => $params, 'r' => & $result);
  3072        $this->batch_queue[] = $batch_item;
  3073      }
  3074
  3075      return $result;
  3076    }

The problem normally happens if I try to set the same message for a user in very short time difference .. however there can be also other occurrings that I am unable to track right now.

Has someone faced problems before while updating statuses multiple times in a short time span.

I am not sure if this has something to do with this question