diff options
| author | Jack Nagel | 2013-12-03 22:16:37 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-03 22:16:37 -0600 |
| commit | ac1fd380759ebe9aa3fe42465cd5d38b209c32b5 (patch) | |
| tree | 1f1b8d2eba76fe4bc6dd7c1a3fc0d5b288f15da6 /Library | |
| parent | 9f2d4f7f8234765e48c839ee835a9a27de0e1b7a (diff) | |
| download | homebrew-ac1fd380759ebe9aa3fe42465cd5d38b209c32b5.tar.bz2 | |
Make CompilerSelectionError an InstallationError
Fixes #19962.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/compilers.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/shared.rb | 6 |
3 files changed, 6 insertions, 9 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 6f5b570b0..9561fc0fb 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -73,7 +73,7 @@ class CompilerSelector end while @f.fails_with?(cc) if cc.nil? - raise CompilerSelectionError + raise CompilerSelectionError.new(@f) else cc.name end diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 2a808ae3e..1e1ec89db 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -218,9 +218,10 @@ end # raised by CompilerSelector if the formula fails with all of # the compilers available on the user's system -class CompilerSelectionError < StandardError - def message; <<-EOS.undent - This formula cannot be built with any available compilers. +class CompilerSelectionError < Homebrew::InstallationError + def initialize f + super f, <<-EOS.undent + #{f.name} cannot be built with any available compilers. To install this formula, you may need to: brew install apple-gcc42 EOS diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index 71b5107ee..fd4b78e13 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -116,11 +116,7 @@ module SharedEnvExtension # If no valid compiler is found, raises an exception. def validate_cc!(formula) if formula.fails_with? ENV.compiler - begin - send CompilerSelector.new(formula).compiler - rescue CompilerSelectionError => e - raise e.message - end + send CompilerSelector.new(formula).compiler end end |
