From 901611cb4e9fdaa75d30813a2864deef023cd2f4 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 15 Nov 2018 15:16:14 +0800 Subject: [PATCH] Fix migrate upload url site settings to rescue from invalid URLs. --- app/jobs/onceoff/migrate_url_site_settings.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/jobs/onceoff/migrate_url_site_settings.rb b/app/jobs/onceoff/migrate_url_site_settings.rb index c40b17983fc..a969dbceb95 100644 --- a/app/jobs/onceoff/migrate_url_site_settings.rb +++ b/app/jobs/onceoff/migrate_url_site_settings.rb @@ -37,7 +37,12 @@ module Jobs skip_rate_limit: true, follow_redirect: true ) - rescue OpenURI::HTTPError, Net::OpenTimeout, Net::ReadTimeout, Errno::ECONNREFUSED => e + rescue OpenURI::HTTPError, + Net::OpenTimeout, + Net::ReadTimeout, + Errno::ECONNREFUSED, + Discourse::InvalidParameters => e + logger.info( "Error encountered when trying to download file " + "for #{new_setting}.\n#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}"