Skip to content

Commit

Permalink
Avoid rescue of SignalException in kernel_load and with_friendly_errors
Browse files Browse the repository at this point in the history
This allows SignalException to be handled gracefully by the ruby
interpreter.

(rebased on to master with CI Fix, 6084)

github: fixes rubygems#6090
  • Loading branch information
dekellum committed Oct 14, 2017
1 parent fea177f commit a0c1d73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler/cli/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def kernel_load(file, *args)
signals = Signal.list.keys - RESERVED_SIGNALS
signals.each {|s| trap(s, "DEFAULT") }
Kernel.load(file)
rescue SystemExit
rescue SystemExit, SignalException
raise
rescue Exception => e # rubocop:disable Lint/RescueException
Bundler.ui = ui
Expand Down
2 changes: 2 additions & 0 deletions lib/bundler/friendly_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def issues_url(exception)

def self.with_friendly_errors
yield
rescue SignalException
raise
rescue Exception => e
FriendlyErrors.log_error(e)
exit FriendlyErrors.exit_status(e)
Expand Down

0 comments on commit a0c1d73

Please sign in to comment.