From 0c5b92a6cba8fac0ed6cd2d56b1e1a9f2c2d81d4 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 11 Apr 2018 17:37:06 -0500 Subject: [PATCH] Add error handling for channel refresh --- src/invidious.cr | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 911cf1a8..3776880d 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -140,8 +140,14 @@ channel_threads.times do |i| PG_DB.query(query, i, channel_threads) do |rs| rs.each do client = get_client(youtube_pool) - id = rs.read(String) - channel = get_channel(id, client, PG_DB) + begin + id = rs.read(String) + channel = get_channel(id, client, PG_DB) + rescue ex + STDOUT << id << " : " << ex.message << "\n" + youtube_pool << make_client(YT_URL) + next + end youtube_pool << client end end