function fb_log_exception in Drupal for Facebook 7.4
Same name and namespace in other branches
- 5.2 fb.module \fb_log_exception()
- 6.3 fb.module \fb_log_exception()
- 6.2 fb.module \fb_log_exception()
- 7.3 fb.module \fb_log_exception()
Helper to log exceptions returned from facebook API.
24 calls to fb_log_exception()
- fb_admin_add_token_form_validate in ./
fb.admin.inc - fb_admin_application_edit_form_submit in ./
fb.admin.inc - fb_admin_application_edit_form_validate in ./
fb.admin.inc - Form validation.
- fb_admin_app_info in ./
fb.admin.inc - Display detailed information about an application.
- fb_admin_app_select_form_validate in ./
fb.admin.inc
File
- ./
fb.module, line 1512
Code
function fb_log_exception($e, $detail = NULL, $token = NULL) {
// @TODO: get the translation right.
$text = "{$detail} <em>" . $e
->getMessage() . '</em>';
if (user_access('access administration pages') && error_reporting()) {
drupal_set_message($text, 'error');
if ($e
->getCode() == 100) {
// https://developers.facebook.com/bugs/285682524881107/
}
}
if ($token) {
$link = l(t('debug token'), url('https://developers.facebook.com/tools/debug/access_token', array(
'query' => array(
'q' => $token,
),
)));
}
else {
$link = NULL;
}
watchdog('fb', $text, array(), WATCHDOG_WARNING, $link);
}