fix(CrawlService): Catch whatever Readability might throw at us

fixes #1965

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2023-07-09 16:08:44 +02:00
parent 143ad37e1e
commit 15cb30d3cd
1 changed files with 2 additions and 1 deletions

View File

@ -123,8 +123,9 @@ class CrawlService {
$readability = new Readability($config);
try {
$readability->parse($resp->getBody());
} catch (ParseException $e) {
} catch (\Throwable $e) {
$this->logger->debug(get_class($e)." ".$e->getMessage()."\r\n".$e->getTraceAsString());
return;
}
$bookmark->setHtmlContent($readability->getContent());
$bookmark->setTextContent(strip_tags($readability->getContent()));