aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/readall.rb2
-rw-r--r--Library/Homebrew/cmd/untap.rb2
-rw-r--r--Library/Homebrew/exceptions.rb12
3 files changed, 14 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb
index 9216f6377..260a1750d 100644
--- a/Library/Homebrew/cmd/readall.rb
+++ b/Library/Homebrew/cmd/readall.rb
@@ -35,7 +35,7 @@ module Homebrew
formulae = Formula.full_names
else
tap = Tap.new(*tap_args)
- raise "#{tap} does not exist!" unless tap.installed?
+ raise TapUnavailableError, tap.name unless tap.installed?
formulae = tap.formula_files
end
diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb
index dd66cec1b..f1040bb05 100644
--- a/Library/Homebrew/cmd/untap.rb
+++ b/Library/Homebrew/cmd/untap.rb
@@ -7,7 +7,7 @@ module Homebrew
ARGV.named.each do |tapname|
tap = Tap.new(*tap_args(tapname))
- raise "No such tap!" unless tap.installed?
+ raise TapUnavailableError, tap.name unless tap.installed?
puts "Untapping #{tap}... (#{tap.path.abv})"
formula_count = tap.formula_files.size
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index 7ae185d00..7eb053a7c 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -84,6 +84,18 @@ class TapFormulaAmbiguityError < RuntimeError
end
end
+class TapUnavailableError < RuntimeError
+ attr_reader :name
+
+ def initialize name
+ @name = name
+
+ super <<-EOS.undent
+ No available tap #{name}.
+ EOS
+ end
+end
+
class OperationInProgressError < RuntimeError
def initialize name
message = <<-EOS.undent