tap: remove redundant exception.

Don't raise an exception only to catch it.
This commit is contained in:
Mike McQuaid 2020-09-30 16:33:43 +01:00
parent 541bc5f745
commit f5ffd71266
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -38,12 +38,9 @@ class Tap
def self.from_path(path)
match = File.expand_path(path).match(HOMEBREW_TAP_PATH_REGEX)
raise "Invalid tap path '#{path}'" unless match
return if match.blank? || match[:user].blank? || match[:repo].blank?
fetch(match[:user], match[:repo])
rescue
# No need to error as a nil tap is sufficient to show failure.
nil
end
def self.default_cask_tap