* fix(twitch): log instead of exception

* typo
This commit is contained in:
Dag 2024-03-31 21:32:27 +02:00 committed by GitHub
parent 73289324bd
commit 17a3b4c9d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -121,7 +121,7 @@ class RedditBridge extends BridgeAbstract
$comments = false;
$frontend = $this->getInput('frontend');
if ($frontend == '') {
$frontend = 'https://old.reddit.com';
$frontend = 'https://old.reddit.com';
}
$section = $this->getInput('d');

View file

@ -95,10 +95,14 @@ EOD;
if ($data->user === null) {
throw new \Exception(sprintf('Unable to find channel `%s`', $channel));
}
$user = $data->user;
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;