function flickr_set_error in Flickr 7
Same name and namespace in other branches
- 5 flickr.inc \flickr_set_error()
 - 6 flickr.inc \flickr_set_error()
 
Display an error message to flickr admins and write an error to watchdog.
Parameters
string $message_or_response: Message or error response to display.
2 calls to flickr_set_error()
- flickrcachewarmer_run in cachewarmer/
flickrcachewarmer.module  - Virtually visits all nodes of selected content types to ensure the cache of these pages is rebuild to avoid long page loads for a real visitor. Note that with the HEAD method the server MUST NOT return a message-body in the response. It turns out…
 - flickr_request in ./
flickr.inc  - Submit a request to Flickr.
 
File
- ./
flickr.inc, line 485  - The Flickr API functions.
 
Code
function flickr_set_error($message_or_response) {
  if (is_array($message_or_response)) {
    $message = t('Flickr error @error_id: %flickr_error', array(
      '@error_id' => $message_or_response['code'],
      '%flickr_error' => $message_or_response['message'],
    ));
    if ($message_or_response['code'] == 100) {
      $message .= '. ' . t('No valid Flickr API key has been set at !link.', array(
        '!link' => l('admin/config/media/flickr', 'admin/config/media/flickr'),
      ));
    }
  }
  else {
    $message = $message_or_response;
  }
  if (user_access('administer flickr')) {
    drupal_set_message($message, 'error', FALSE);
  }
  watchdog('flickr', $message, array(), WATCHDOG_WARNING);
}