diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-08-03 15:45:52 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-08-04 18:09:57 -0500 |
commit | 7fb0e91d9b7def611e2867bd41d8300c06594fde (patch) | |
tree | 24481cae9191adafb905ac33a2a77190be32a5b8 | |
parent | 240ea12d8e053440f41b0b0352bbbd6c3739393d (diff) | |
download | bundler-7fb0e91d9b7def611e2867bd41d8300c06594fde.tar.gz |
[ParallelInstaller] Only raise when there is an error
-rw-r--r-- | lib/bundler/installer/parallel_installer.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb index ecc355ef48..18bfe0897c 100644 --- a/lib/bundler/installer/parallel_installer.rb +++ b/lib/bundler/installer/parallel_installer.rb @@ -90,7 +90,7 @@ module Bundler def call enqueue_specs process_specs until @specs.all?(&:installed?) || @specs.any?(&:failed?) - raise Bundler::InstallError, @specs.select(&:failed?).map(&:error).map(&:to_s).join("\n\n") + handle_error if @specs.any?(&:failed?) ensure worker_pool && worker_pool.stop end @@ -129,6 +129,14 @@ module Bundler Bundler::Installer.post_install_messages[spec.name] = spec.post_install_message end + def handle_error + errors = @specs.select(&:failed?).map(&:error) + if exception = errors.find {|e| e.is_a?(Bundler::Error) } + raise exception + end + raise Bundler::InstallError, errors.map(&:to_s).join("\n\n") + end + # Keys in the remains hash represent uninstalled gems specs. # We enqueue all gem specs that do not have any dependencies. # Later we call this lambda again to install specs that depended on |