From f5ffd712668156aaf5ca0cf468d9d238d9f7ecf7 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 30 Sep 2020 16:33:43 +0100 Subject: [PATCH] tap: remove redundant exception. Don't raise an exception only to catch it. --- Library/Homebrew/tap.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 582fdd0fd8..e0e8244a1c 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -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