summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2022-02-07 00:52:18 +0100
committerSamantaz Fox <coding@samantaz.fr>2022-02-07 00:52:18 +0100
commit698a6f38863c399b50cda27b5b509be2980e8a21 (patch)
treeb3b8957b3e60f6539ca4dc48626b5f726251c444 /src
parent1668e4187ee1c1432e9af7b71bb266be60ca72e1 (diff)
downloadinvidious-698a6f38863c399b50cda27b5b509be2980e8a21.tar.gz
invidious-698a6f38863c399b50cda27b5b509be2980e8a21.tar.bz2
invidious-698a6f38863c399b50cda27b5b509be2980e8a21.zip
API: handle related channels parsing exceptions
Diffstat (limited to 'src')
-rw-r--r--src/invidious/routes/api/v1/channels.cr6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/invidious/routes/api/v1/channels.cr b/src/invidious/routes/api/v1/channels.cr
index 83c6db04..c4d6643a 100644
--- a/src/invidious/routes/api/v1/channels.cr
+++ b/src/invidious/routes/api/v1/channels.cr
@@ -97,7 +97,11 @@ module Invidious::Routes::API::V1::Channels
json.field "relatedChannels" do
json.array do
# Fetch related channels
- related_channels = fetch_related_channels(channel)
+ begin
+ related_channels = fetch_related_channels(channel)
+ rescue ex
+ related_channels = [] of AboutRelatedChannel
+ end
related_channels.each do |related_channel|
json.object do