From a5640fdfeeea7347e51c14abac481f4b210527ab Mon Sep 17 00:00:00 2001 From: Alexey Alekhin Date: Wed, 23 Aug 2017 16:54:21 +0200 Subject: [PATCH] Added rescue block for the remote cask search failure --- Library/Homebrew/cask/lib/hbc/cli/search.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb index 42be4592ae..9f4f9f31d1 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/search.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb @@ -19,8 +19,18 @@ module Hbc end def self.search_remote(query) - matches = GitHub.search_code(user: "caskroom", path: "Casks", - filename: query, extension: "rb") + matches = begin GitHub.search_code( + user: "caskroom", + path: "Casks", + filename: query, + extension: "rb" + ) + rescue Exception => e + onoe e + $stderr.puts e.backtrace + [] + end + matches.map do |match| tap = Tap.fetch(match["repository"]["full_name"]) next if tap.installed?