You are here

function fb_report_errors in Drupal for Facebook 6.2

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

Convenience method for displaying facebook api errors.

3 calls to fb_report_errors()
fb_app_user in ./fb_app.module
Implementation of hook_user.
fb_get_friends in ./fb.module
A convenience method for returning a list of facebook friends.
_fb_register_register_users in contrib/fb_register.module
Register a chunk of users.

File

./fb.module, line 788

Code

function fb_report_errors($fb = FB_APP_CURRENT, $message = NULL) {
  if ($fb == FB_APP_CURRENT) {
    $fb = $GLOBALS['_fb'];
  }
  if ($fb) {
    if (isset($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, array(), WATCHDOG_ERROR);
      if (user_access(FB_PERM_ADMINISTER)) {
        drupal_set_message($message, 'error');
      }
    }
  }
}