You are here

function fb_report_errors in Drupal for Facebook 5.2

Same name and namespace in other branches
  1. 5 fb.module \fb_report_errors()
  2. 6.2 fb.module \fb_report_errors()

Convenience method for displaying facebook api errors.

4 calls to fb_report_errors()
fb_actions_ref_fbml in ./fb_actions.module
fb_app_user in ./fb_app.module
Implementation of hook_user.
fb_feed_deactivate_template in ./fb_feed.module
fb_get_friends in ./fb.module
A convenience method for returning a list of facebook friends. This should work efficiently in canvas pages for finding friends of the current user. In other cases it tries to work, but will be an expensive operation and only succeed when the user…

File

./fb.module, line 637

Code

function fb_report_errors($fb = FB_APP_CURRENT, $message = NULL) {
  if ($fb == FB_APP_CURRENT) {
    $fb = $GLOBALS['fb'];
  }
  if ($fb) {
    if ($fb->api_client->error_code) {
      $message = t('!message Facebook API error %code (see !link).', array(
        '%code' => $fb->api_client->error_code,
        '!link' => l(t('error codes'), "http://wiki.developers.facebook.com/index.php/Error_codes"),
        '!message' => $message,
      ));
      watchdog('fb', $message, WATCHDOG_ERROR);
      drupal_set_message($message, 'error');
    }
  }
}