From b8103eb8fbcd3671dc3244922ae9fc1c9364d391 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 21 Oct 2013 20:16:41 +0100 Subject: tap: use dedicated exception for already tapped. --- Library/Homebrew/cmd/tap.rb | 2 +- Library/Homebrew/exceptions.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 23c63cb5b..21ad00c6e 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -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 = [] diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 1ea06381a..9764879bd 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -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 -- cgit v1.2.3