From 1a600126126e2f531377646e929280c756e69929 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 22 Mar 2023 12:25:40 +0900 Subject: [rubygems/rubygems] util/rubocop -A --only Lint/RescueException https://github.com/rubygems/rubygems/commit/e8a5db50af --- lib/rubygems.rb | 2 +- lib/rubygems/command_manager.rb | 2 +- lib/rubygems/core_ext/kernel_require.rb | 2 +- lib/rubygems/indexer.rb | 2 +- lib/rubygems/specification.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3