From 3ecee2982b2b1a8e34e2d6d610c6fd92dc421365 Mon Sep 17 00:00:00 2001 From: Dag Date: Sun, 31 Mar 2024 21:28:33 +0200 Subject: [PATCH] fix(twitch): log instead of exception --- bridges/RedditBridge.php | 2 +- bridges/TwitchBridge.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bridges/RedditBridge.php b/bridges/RedditBridge.php index fbc6f67891c..7ece0e15b30 100644 --- a/bridges/RedditBridge.php +++ b/bridges/RedditBridge.php @@ -121,7 +121,7 @@ private function collectDataInternal(): void $comments = false; $frontend = $this->getInput('frontend'); if ($frontend == '') { - $frontend = 'https://old.reddit.com'; + $frontend = 'https://old.reddit.com'; } $section = $this->getInput('d'); diff --git a/bridges/TwitchBridge.php b/bridges/TwitchBridge.php index f408f8855ca..442cfdbbe59 100644 --- a/bridges/TwitchBridge.php +++ b/bridges/TwitchBridge.php @@ -96,9 +96,13 @@ public function collectData() throw new \Exception(sprintf('Unable to find channel `%s`', $channel)); } $user = $data->user; + $user->videos = null; if ($user->videos === null) { - throw new HttpException('Service Unavailable', 503); + // twitch regularly does this for unknown reasons + $this->logger->info('Twitch returned empty set of videos', ['data' => $data]); + return; } + foreach ($user->videos->edges as $edge) { $video = $edge->node;