]> git.wh0rd.org - tt-rss.git/commitdiff
synchronous feed update: catch PDO exceptions as to not break headlines output
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 10 Dec 2017 18:10:19 +0000 (21:10 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 10 Dec 2017 18:10:19 +0000 (21:10 +0300)
classes/feeds.php

index 7b5531464db1d38c05dfcb7d847da39e5321e7ed..e875eeb7f89bc506a36920a9fcf60135dd733281 100755 (executable)
@@ -202,7 +202,11 @@ class Feeds extends Handler_Protected {
                                        $cache_images = $row["cache_images"];
 
                                        if (!$cache_images && time() - $last_updated > 120) {
-                                               RSSUtils::update_rss_feed($feed, true);
+                                           try {
+                                                       RSSUtils::update_rss_feed($feed, true);
+                                               } catch (PDOException $e) {
+                                               user_error("PDO Exception while doing on-demand feed update for $feed: " . $e->getMessage(), E_USER_NOTICE);
+                        }
                                        } else {
                                                $sth = $this->pdo->prepare("UPDATE ttrss_feeds 
                                 SET last_updated = '1970-01-01', last_update_started = '1970-01-01'