FIX: Give up migration of URL site settings if there is an SSL error

FIX: Give up migration of URL site settings if there is an SSL error.

From a8603e04ab12f803cef118c4b0cff0dbe9b4f178 Mon Sep 17 00:00:00 2001
From: Guo Xiang Tan <tgx_world@hotmail.com>
Date: Thu, 22 Nov 2018 12:14:27 +0800
Subject: [PATCH] FIX: Give up migration of URL site settings if there is an
 SSL error.


diff --git a/app/jobs/onceoff/migrate_url_site_settings.rb b/app/jobs/onceoff/migrate_url_site_settings.rb
index 119199b..a5588d1 100644
--- a/app/jobs/onceoff/migrate_url_site_settings.rb
+++ b/app/jobs/onceoff/migrate_url_site_settings.rb
@@ -40,6 +40,7 @@ module Jobs
               follow_redirect: true
             )
           rescue OpenURI::HTTPError,
+                 OpenSSL::SSL::SSLError,
                  Net::OpenTimeout,
                  Net::ReadTimeout,
                  Errno::ECONNREFUSED,

GitHub

1 Like

I totally get not wanting a “rescue everything” the flip side though is … new ruby comes out, new exception pops up, more maintenance is required. Plus the 3 followup commits to add all the rescues we miss.

I guess there is just no way of having the cake and eating it too

1 Like