diff --git a/src/invidious/connection/pool.cr b/src/invidious/connection/pool.cr index f5d22f77..777188e5 100644 --- a/src/invidious/connection/pool.cr +++ b/src/invidious/connection/pool.cr @@ -72,7 +72,7 @@ module Invidious::ConnectionPool response = yield http_client rescue ex : DB::PoolTimeout # Failed to checkout a client - raise ConnectionPool::Error.new(ex.message, cause: ex) + raise ConnectionPool::PoolCheckoutError.new(ex.message) rescue ex # An error occurred with the client itself. # Delete the client from the pool and close the connection @@ -131,6 +131,10 @@ module Invidious::ConnectionPool class Error < Exception end + # Raised when the pool failed to get a client in time + class PoolCheckoutError < Error + end + # Mapping of subdomain => Invidious::ConnectionPool::Pool # This is needed as we may need to access arbitrary subdomains of ytimg private YTIMG_POOLS = {} of String => ConnectionPool::Pool