function tweet_feed_bail in Tweet Feed 7.2
Same name and namespace in other branches
- 7.3 tweet_feed.module \tweet_feed_bail()
Custom error quit function
If we have an error and we need to bail, this function handles that gracefully depending on whether or not we are being called by web or cli
Parameters
bool admin: Are we coming from the administrative pages?
1 call to tweet_feed_bail()
- tweet_feed_save_tweet in ./
tweet_feed.module - Save The Tweet (and profile)
File
- ./
tweet_feed.module, line 1036
Code
function tweet_feed_bail($admin = FALSE) {
// Drush command
if (function_exists('drush_print')) {
drush_set_error('Exiting.', 'fatal');
}
else {
// If we're using the web interface, then throw a message and go to the home page
// if this is user facing or the admin if an administrative function
if (!empty($admin)) {
drupal_goto('admin/config/services/tweet_feed');
}
else {
drupal_goto('<front>');
}
}
}