diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index a03738bc82..2d3a28f367 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -112,7 +112,7 @@ module Homebrew extend self end end results - rescue OpenURI::HTTPError, GitHub::Error + rescue GitHub::Error opoo "Failed to search tap: #{user}/#{repo}. Please run `brew update`" [] end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 2f5bf1b0d1..73495e31c3 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -266,13 +266,13 @@ module GitHub extend self end rescue OpenURI::HTTPError => e 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']} You may want to create an API token: https://github.com/settings/applications and then set HOMEBREW_GITHUB_API_TOKEN. EOS else - raise e + raise Error, e.message end rescue SocketError, OpenSSL::SSL::SSLError => e raise Error, "Failed to connect to: #{url}\n#{e.message}"