Skip to content

Invidious is an alternative front-end to YouTube

Rescue DB errors in get_video()

Samantaz Fox135aaf56fdd1
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr
index b50e7b2c..31ae90c7 100644
--- a/src/invidious/videos.cr
+++ b/src/invidious/videos.cr
@@ -1094,6 +1094,10 @@ def get_video(id, refresh = true, region = nil, force_refresh = false)
end
return video
+rescue DB::Error
+ # Avoid common `DB::PoolRetryAttemptsExceeded` error and friends
+ # Note: All DB errors inherit from `DB::Error`
+ return fetch_video(id, region)
end
def fetch_video(id, region)