Extract wrapper constant for HTTP::* error classes (#32285)
				
					
				
			This commit is contained in:
		@@ -36,4 +36,10 @@ module Mastodon
 | 
			
		||||
      super()
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  HTTP_CONNECTION_ERRORS = [
 | 
			
		||||
    HTTP::ConnectionError,
 | 
			
		||||
    HTTP::Error,
 | 
			
		||||
    HTTP::TimeoutError,
 | 
			
		||||
  ].freeze
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -305,7 +305,7 @@ module Mastodon::CLI
 | 
			
		||||
 | 
			
		||||
        begin
 | 
			
		||||
          code = Request.new(:head, account.uri).perform(&:code)
 | 
			
		||||
        rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Mastodon::PrivateNetworkAddressError
 | 
			
		||||
        rescue *Mastodon::HTTP_CONNECTION_ERRORS, OpenSSL::SSL::SSLError, Mastodon::PrivateNetworkAddressError
 | 
			
		||||
          skip_domains << account.domain
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user