diff options
| author | Jack Nagel | 2014-02-08 16:04:53 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-02-08 16:04:53 -0500 |
| commit | 013482bf941719a9e24d33a058e2472d4599b98f (patch) | |
| tree | d93f8423ea27d52820b7140bcd6017990bde70bf | |
| parent | 0a7767b247f6289f0dbd2b6601dfc4ce320ce585 (diff) | |
| download | homebrew-013482bf941719a9e24d33a058e2472d4599b98f.tar.bz2 | |
Raise only GitHub::Error from GitHub.open
| -rw-r--r-- | Library/Homebrew/cmd/search.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 4 |
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}" |
