Rescue from read and connect timeouts when migration url site settings.

This commit is contained in:
Guo Xiang Tan
2018-11-14 18:46:34 +08:00
parent 861b52b6f3
commit 777364df01

View File

@@ -33,10 +33,10 @@ class MigrateUrlSiteSettings < ActiveRecord::Migration[5.2]
skip_rate_limit: true, skip_rate_limit: true,
follow_redirect: true follow_redirect: true
) )
rescue OpenURI::HTTPError => e rescue OpenURI::HTTPError, Net::OpenTimeout, Net::ReadTimeout => e
logger.info( logger.info(
"HTTP error encountered when trying to download file " + "HTTP error encountered when trying to download file " +
"for #{new_setting}.\n#{e.message}" "for #{new_setting}.\n#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}"
) )
end end