From 08c3fb0ed2b1ae7d7e756b341bf2f9b2ccd7d889 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 1 Jul 2013 16:58:16 -0500 Subject: Better behavior for failed connections in `brew search` Fixes #20868. --- Library/Homebrew/cmd/search.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 2ec8afd81..ea4b655f5 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -33,7 +33,11 @@ module Homebrew extend self if count == 0 and not blacklisted? query puts "No formula found for #{query.inspect}. Searching open pull requests..." - GitHub.find_pull_requests(rx) { |pull| puts pull } + begin + GitHub.find_pull_requests(rx) { |pull| puts pull } + rescue GitHub::Error => e + opoo e.message + end end end end @@ -81,6 +85,8 @@ module Homebrew extend self end end results + rescue GitHub::Error + [] end def search_formulae rx -- cgit v1.2.3