tap: use dedicated exception for already tapped.

This commit is contained in:
Mike McQuaid 2013-10-21 20:16:41 +01:00
parent 0055e4dc5f
commit 1cb7eca3a5
2 changed files with 6 additions and 1 deletions

View File

@ -23,7 +23,7 @@ module Homebrew extend self
# we downcase to avoid case-insensitive filesystem issues
tapd = HOMEBREW_LIBRARY/"Taps/#{user.downcase}-#{repo.downcase}"
raise "Already tapped!" if tapd.directory?
raise AlreadyTappedError if tapd.directory?
abort unless system "git clone https://github.com/#{repouser}/homebrew-#{repo} #{tapd}"
files = []

View File

@ -221,6 +221,11 @@ class CompilerSelectionError < StandardError
end
end
# raised in install_tap
class AlreadyTappedError < RuntimeError
def initialize; super "Already tapped!" end
end
# raised in CurlDownloadStrategy.fetch
class CurlDownloadStrategyError < RuntimeError; end