diff options
author | Andre Arko <andre@arko.net> | 2012-03-10 20:14:54 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2012-03-10 20:14:54 -0800 |
commit | 1f2cd74eefbe4c5b5677b78e50375d3d2a46eb15 (patch) | |
tree | c753cd53dd2643868335a466f0638a411a539ae3 | |
parent | abdc6374bd18488d0732a61c21fe028d9cc93e85 (diff) | |
download | bundler-1f2cd74eefbe4c5b5677b78e50375d3d2a46eb15.tar.gz |
raising Gem::InstallError is the worst possible thing
This code meant that _any_ gem install failure resulted in a message requesting the user to report this "bug" to the Bundler issue tracker. That is very, very not cool, and I had already fixed this issue once before the hook pull request regressed it. :(
-rw-r--r-- | lib/bundler.rb | 1 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source.rb | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 9595978cab..80f8366116 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -45,6 +45,7 @@ module Bundler class GemNotFound < BundlerError; status_code(7) ; end class GemfileError < BundlerError; status_code(4) ; end class InstallError < BundlerError; status_code(5) ; end + class InstallHookError < BundlerError; status_code(6) ; end class PathError < BundlerError; status_code(13) ; end class GitError < BundlerError; status_code(11) ; end class DeprecatedError < BundlerError; status_code(12) ; end diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 8fd690202c..262ea0d032 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -83,7 +83,7 @@ module Bundler FileUtils.rm_rf(Bundler.tmp) rescue Exception => e # install hook failed - raise e if e.is_a?(Gem::InstallError) + raise e if e.is_a?(Bundler::InstallHookError) # other failure, likely a native extension build failure Bundler.ui.info "" diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 5de77d1f94..5e058752e0 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -472,7 +472,7 @@ module Bundler if result == false location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/ message = "#{type} hook#{location} failed for #{installer.spec.full_name}" - raise Gem::InstallError, message + raise InstallHookError, message end end end |