1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-09-03 05:02:43 +02:00

fix: small tweaks (#4057)

This commit is contained in:
Dag
2024-04-04 19:12:04 +02:00
committed by GitHub
parent 3cba984d22
commit 001dd47439
4 changed files with 13 additions and 44 deletions

View File

@@ -64,6 +64,7 @@ TEXT;
$this->collectExpandableDatas($feed);
} catch (HttpException $e) {
$this->logger->warning(sprintf('Exception in FeedMergeBridge: %s', create_sane_exception_message($e)));
// This feed item might be spammy. Considering dropping it.
$this->items[] = [
'title' => 'RSS-Bridge: ' . $e->getMessage(),
// Give current time so it sorts to the top
@@ -71,7 +72,7 @@ TEXT;
];
continue;
} catch (\Exception $e) {
if (str_starts_with($e->getMessage(), 'Unable to parse xml')) {
if (str_starts_with($e->getMessage(), 'Failed to parse xml')) {
// Allow this particular exception from FeedExpander
$this->logger->warning(sprintf('Exception in FeedMergeBridge: %s', create_sane_exception_message($e)));
continue;
@@ -83,6 +84,8 @@ TEXT;
}
}
// If $this->items is empty we should consider throw exception here
// Sort by timestamp descending
usort($this->items, function ($a, $b) {
$t1 = $a['timestamp'] ?? $a['uri'] ?? $a['title'];