Skip to content

Commit

Permalink
fix(twitch): log instead of exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan committed Mar 31, 2024
1 parent 7328932 commit 3ecee29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bridges/RedditBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
6 changes: 5 additions & 1 deletion bridges/TwitchBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3ecee29

Please sign in to comment.