add TapUnavailableError
This commit is contained in:
parent
696d7f3ba0
commit
b88cb13718
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user