From 1429c2f44eafd0eb85ea44b21ff67217b8000368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Thu, 29 Aug 2013 20:52:44 -0400 Subject: [PATCH] Handle 404 errors and add debug call --- model.php | 6 ++++-- vendor/PicoFeed/Client.php | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/model.php b/model.php index 35a36ac..6d3087b 100644 --- a/model.php +++ b/model.php @@ -180,8 +180,10 @@ function import_feed($url) $feed = $parser->execute(); - if ($feed === false) return false; - if (! $feed->title || ! $feed->url) return false; + if ($feed === false || ! $feed->title || ! $feed->url) { + write_debug(); + return false; + } $db = \PicoTools\singleton('db'); diff --git a/vendor/PicoFeed/Client.php b/vendor/PicoFeed/Client.php index 52960cc..e832422 100644 --- a/vendor/PicoFeed/Client.php +++ b/vendor/PicoFeed/Client.php @@ -58,6 +58,9 @@ abstract class Client $this->is_modified = false; Logging::log(\get_called_class().' Resource not modified'); } + else if ($response['status'] == 404) { + Logging::log(\get_called_class().' Resource not found'); + } else { $this->etag = isset($response['headers']['ETag']) ? $response['headers']['ETag'] : ''; $this->last_modified = isset($response['headers']['Last-Modified']) ? $response['headers']['Last-Modified'] : '';