Skip to content
Permalink
Browse files

Fixes to error handling on twitter_feed block

  • Loading branch information...
chrisgraham committed May 30, 2019
1 parent 4d25097 commit ba8abc48c590cf3b85690f17453b91dbe3d0c59e
Showing with 4 additions and 1 deletion.
  1. +4 −1 sources_custom/blocks/twitter_feed.php
@@ -71,6 +71,9 @@ public function run($map)
$token = get_value('twitter_oauth_token', null, true);
$token_secret = get_value('twitter_oauth_token_secret', null, true);
}
if (($api_key == '') || ($api_secret == '')) {
return paragraph('API options are not configured.', '', 'red_alert');
}
$twitter_query = array_key_exists('screen_name', $map) ? $map['screen_name'] : 'coolweens';
if (preg_match('#^\w+$#', $twitter_query) != 0) {
@@ -169,7 +172,7 @@ public function run($map)
$twitter_result = $twitter->searchTweets($twitter_query, null, null, null, null, $twitter_maxstatuses);
$twitter_statuses = $twitter_result['statuses'];
}
} catch (TwitterException $e) {
} catch (Exception $e) {
$twitter_error = $e->getMessage();
$twitter_error .= '<br />';
return do_template($twitter_templatemain, array(

0 comments on commit ba8abc4

Please sign in to comment.
You can’t perform that action at this time.