Skip to content

Commit

Permalink
[rubygems/rubygems] Move list of exceptions to the rescue clause
Browse files Browse the repository at this point in the history
Instead of having to match classes and re-raise in the exception body.

rubygems/rubygems@5edf74b781
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 31, 2021
1 parent 87dfb55 commit 0aa9eb9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/rubygems.rb
Expand Up @@ -1120,15 +1120,10 @@ def self.use_gemdeps(path = nil)
end
end

rescue => e
case e
when Gem::LoadError, Gem::UnsatisfiableDependencyError, (defined?(Bundler::GemNotFound) ? Bundler::GemNotFound : Gem::LoadError)
warn e.message
warn "You may need to `gem install -g` to install missing gems"
warn ""
else
raise
end
rescue Gem::LoadError, Gem::UnsatisfiableDependencyError, (defined?(Bundler::GemNotFound) ? Bundler::GemNotFound : Gem::LoadError) => e
warn e.message
warn "You may need to `gem install -g` to install missing gems"
warn ""
end

##
Expand Down

0 comments on commit 0aa9eb9

Please sign in to comment.