summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-22 12:25:40 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-23 17:18:49 +0900
commit1a600126126e2f531377646e929280c756e69929 (patch)
treeb5880e41993fbabf1edb9c11348ea0dc5e6378c7 /lib
parent25ed2e7415ded52837e3ade1b43efe1def9493d2 (diff)
[rubygems/rubygems] util/rubocop -A --only Lint/RescueException
https://github.com/rubygems/rubygems/commit/e8a5db50af
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7582
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/command_manager.rb2
-rw-r--r--lib/rubygems/core_ext/kernel_require.rb2
-rw-r--r--lib/rubygems/indexer.rb2
-rw-r--r--lib/rubygems/specification.rb2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 00749bc0cf..9f63c027c9 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -1011,7 +1011,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
begin
load plugin
- rescue ::Exception => e
+ rescue ScriptError, StandardError => e
details = "#{plugin.inspect}: #{e.message} (#{e.class})"
warn "Error loading RubyGems plugin #{details}"
end
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb
index 5ceaf1c63c..8af31824ee 100644
--- a/lib/rubygems/command_manager.rb
+++ b/lib/rubygems/command_manager.rb
@@ -237,7 +237,7 @@ class Gem::CommandManager
load_error = e
end
Gem::Commands.const_get(const_name).new
- rescue Exception => e
+ rescue StandardError => e
e = load_error if load_error
alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 5f768f3b23..69edcd23af 100644
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -70,7 +70,7 @@ module Kernel
begin
Kernel.send(:gem, spec.name, Gem::Requirement.default_prerelease)
- rescue Exception
+ rescue StandardError
RUBYGEMS_ACTIVATION_MONITOR.exit
raise
end unless resolved_path
diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb
index d0061ff82e..cb8abc286d 100644
--- a/lib/rubygems/indexer.rb
+++ b/lib/rubygems/indexer.rb
@@ -200,7 +200,7 @@ class Gem::Indexer
rescue SignalException
alert_error "Received signal, exiting"
raise
- rescue Exception => e
+ rescue StandardError => e
msg = ["Unable to process #{gemfile}",
"#{e.message} (#{e.class})",
"\t#{e.backtrace.join "\n\t"}"].join("\n")
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 1cb6873db0..f003dad777 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1179,7 +1179,7 @@ class Gem::Specification < Gem::BasicSpecification
warn "[#{file}] isn't a Gem::Specification (#{_spec.class} instead)."
rescue SignalException, SystemExit
raise
- rescue SyntaxError, Exception => e
+ rescue SyntaxError, StandardError => e
warn "Invalid gemspec in [#{file}]: #{e}"
end