Skip to content

Commit

Permalink
refactor: change to catch Timeout::Error
Browse files Browse the repository at this point in the history
Change to catch Timeout::Error during making an HTTP request
  • Loading branch information
ninoseki committed Nov 6, 2019
1 parent 577e456 commit 1c067d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/apullo/fingerprints/favicon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get(path)
response = http.request(request)

response.code.to_i == 200 ? response.body : nil
rescue Errno::ECONNREFUSED, Net::HTTPError, OpenSSL::OpenSSLError => _e
rescue Errno::ECONNREFUSED, Net::HTTPError, OpenSSL::OpenSSLError, Timeout::Error => _e
nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/apullo/fingerprints/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get(path, limit: 3)
@body = response.body
@path = path
end
rescue Errno::ECONNREFUSED, Net::HTTPError, OpenSSL::OpenSSLError => _e
rescue Errno::ECONNREFUSED, Net::HTTPError, OpenSSL::OpenSSLError, Timeout::Error => _e
nil
end

Expand Down

0 comments on commit 1c067d0

Please sign in to comment.