[rubygems/rubygems] util/rubocop -A --only Lint/RescueException
https://github.com/rubygems/rubygems/commit/e8a5db50af
This commit is contained in:
parent
25ed2e7415
commit
1a60012612
Notes:
git
2023-03-23 08:19:26 +00:00
@ -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
|
||||
|
@ -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}")
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
TestGem::TEST_PLUGIN_EXCEPTION = :loaded
|
||||
raise Exception.new("boom")
|
||||
raise ScriptError.new("boom")
|
@ -1527,7 +1527,7 @@ class TestGem < Gem::TestCase
|
||||
util_remove_interrupt_command
|
||||
|
||||
# Should attempt to cause an Exception
|
||||
with_plugin("exception") { Gem.load_env_plugins }
|
||||
with_plugin("scripterror") { Gem.load_env_plugins }
|
||||
begin
|
||||
assert_equal :loaded, TEST_PLUGIN_EXCEPTION
|
||||
rescue StandardError
|
||||
|
@ -41,7 +41,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
||||
assert_match(/Finished/, output)
|
||||
assert_match(/release/, output)
|
||||
assert_ffi_handle bundle, "Init_rust_ruby_example"
|
||||
rescue Exception => e
|
||||
rescue StandardError => e
|
||||
pp output if output
|
||||
|
||||
raise(e)
|
||||
@ -67,7 +67,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
||||
assert_ffi_handle bundle, "hello_from_rubygems"
|
||||
assert_ffi_handle bundle, "hello_from_rubygems_version"
|
||||
refute_ffi_handle bundle, "should_never_exist"
|
||||
rescue Exception => e
|
||||
rescue StandardError => e
|
||||
pp output if output
|
||||
|
||||
raise(e)
|
||||
|
@ -1158,7 +1158,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
||||
server.ssl_context.tmp_dh_callback = proc { TEST_KEY_DH2048 }
|
||||
t = Thread.new do
|
||||
server.start
|
||||
rescue Exception => ex
|
||||
rescue StandardError => ex
|
||||
puts "ERROR during server thread: #{ex.message}"
|
||||
raise
|
||||
ensure
|
||||
@ -1210,7 +1210,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
||||
end
|
||||
th = Thread.new do
|
||||
s.start
|
||||
rescue Exception => ex
|
||||
rescue StandardError => ex
|
||||
abort "ERROR during server thread: #{ex.message}"
|
||||
ensure
|
||||
s.shutdown
|
||||
|
Loading…
x
Reference in New Issue
Block a user