Extract wrapper constant for HTTP::*
error classes (#32285)
This commit is contained in:
parent
f49161ab1d
commit
e8ec6667bd
21 changed files with 29 additions and 23 deletions
|
@ -22,7 +22,7 @@ class SoftwareUpdateCheckService < BaseService
|
|||
Request.new(:get, "#{api_url}?version=#{version}").add_headers('Accept' => 'application/json', 'User-Agent' => 'Mastodon update checker').perform do |res|
|
||||
return Oj.load(res.body_with_limit, mode: :strict) if res.code == 200
|
||||
end
|
||||
rescue HTTP::Error, OpenSSL::SSL::SSLError, Oj::ParseError
|
||||
rescue *Mastodon::HTTP_CONNECTION_ERRORS, OpenSSL::SSL::SSLError, Oj::ParseError
|
||||
nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue