From 135aaf56fdd1ad70571e86f21415da44bc138cd8 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Fri, 8 Apr 2022 22:52:34 +0200 Subject: [PATCH] Rescue DB errors in get_video() --- src/invidious/videos.cr | 4 ++++ 1 file changed, 4 insertions(+) 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)