aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-02-08 16:04:53 -0500
committerJack Nagel2014-02-08 16:04:53 -0500
commit013482bf941719a9e24d33a058e2472d4599b98f (patch)
treed93f8423ea27d52820b7140bcd6017990bde70bf
parent0a7767b247f6289f0dbd2b6601dfc4ce320ce585 (diff)
downloadhomebrew-013482bf941719a9e24d33a058e2472d4599b98f.tar.bz2
Raise only GitHub::Error from GitHub.open
-rw-r--r--Library/Homebrew/cmd/search.rb2
-rw-r--r--Library/Homebrew/utils.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index a03738bc8..2d3a28f36 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 2f5bf1b0d..73495e31c 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}"