Added rescue block for the remote cask search failure

This commit is contained in:
Alexey Alekhin 2017-08-23 16:54:21 +02:00
parent 00803b1a0b
commit a5640fdfee

View File

@ -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?