Handle 404 errors and add debug call
This commit is contained in:
parent
509d36c4b8
commit
1429c2f44e
@ -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');
|
||||
|
||||
|
3
vendor/PicoFeed/Client.php
vendored
3
vendor/PicoFeed/Client.php
vendored
@ -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'] : '';
|
||||
|
Loading…
Reference in New Issue
Block a user