tap: remove redundant exception.
Don't raise an exception only to catch it.
This commit is contained in:
parent
541bc5f745
commit
f5ffd71266
@ -38,12 +38,9 @@ class Tap
|
|||||||
|
|
||||||
def self.from_path(path)
|
def self.from_path(path)
|
||||||
match = File.expand_path(path).match(HOMEBREW_TAP_PATH_REGEX)
|
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])
|
fetch(match[:user], match[:repo])
|
||||||
rescue
|
|
||||||
# No need to error as a nil tap is sufficient to show failure.
|
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.default_cask_tap
|
def self.default_cask_tap
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user