[EconomistBridge] Handle 404s in feed gracefully (#3965)

This commit is contained in:
Korytov Pavel 2024-02-08 17:36:03 +03:00 committed by GitHub
parent 75a0a779c0
commit cfef482366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,12 @@ class EconomistBridge extends FeedExpander
protected function parseItem(array $item)
{
$dom = getSimpleHTMLDOM($item['uri']);
try {
$dom = getSimpleHTMLDOM($item['uri']);
} catch (Exception $e) {
$item['content'] = $e->getMessage();
return $item;
}
$article = $dom->find('#new-article-template', 0);
if ($article == null) {