Raise only GitHub::Error from GitHub.open
This commit is contained in:
parent
4d6df3e3bc
commit
2e3871c076
@ -112,7 +112,7 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
results
|
results
|
||||||
rescue OpenURI::HTTPError, GitHub::Error
|
rescue GitHub::Error
|
||||||
opoo "Failed to search tap: #{user}/#{repo}. Please run `brew update`"
|
opoo "Failed to search tap: #{user}/#{repo}. Please run `brew update`"
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|||||||
@ -266,13 +266,13 @@ module GitHub extend self
|
|||||||
end
|
end
|
||||||
rescue OpenURI::HTTPError => e
|
rescue OpenURI::HTTPError => e
|
||||||
if e.io.meta['x-ratelimit-remaining'].to_i <= 0
|
if e.io.meta['x-ratelimit-remaining'].to_i <= 0
|
||||||
raise <<-EOS.undent
|
raise Error, <<-EOS.undent
|
||||||
GitHub #{Utils::JSON.load(e.io.read)['message']}
|
GitHub #{Utils::JSON.load(e.io.read)['message']}
|
||||||
You may want to create an API token: https://github.com/settings/applications
|
You may want to create an API token: https://github.com/settings/applications
|
||||||
and then set HOMEBREW_GITHUB_API_TOKEN.
|
and then set HOMEBREW_GITHUB_API_TOKEN.
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
raise e
|
raise Error, e.message
|
||||||
end
|
end
|
||||||
rescue SocketError, OpenSSL::SSL::SSLError => e
|
rescue SocketError, OpenSSL::SSL::SSLError => e
|
||||||
raise Error, "Failed to connect to: #{url}\n#{e.message}"
|
raise Error, "Failed to connect to: #{url}\n#{e.message}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user