[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
|
begin
|
||||||
load plugin
|
load plugin
|
||||||
rescue ::Exception => e
|
rescue ScriptError, StandardError => e
|
||||||
details = "#{plugin.inspect}: #{e.message} (#{e.class})"
|
details = "#{plugin.inspect}: #{e.message} (#{e.class})"
|
||||||
warn "Error loading RubyGems plugin #{details}"
|
warn "Error loading RubyGems plugin #{details}"
|
||||||
end
|
end
|
||||||
|
@ -237,7 +237,7 @@ class Gem::CommandManager
|
|||||||
load_error = e
|
load_error = e
|
||||||
end
|
end
|
||||||
Gem::Commands.const_get(const_name).new
|
Gem::Commands.const_get(const_name).new
|
||||||
rescue Exception => e
|
rescue StandardError => e
|
||||||
e = load_error if load_error
|
e = load_error if load_error
|
||||||
|
|
||||||
alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
|
alert_error clean_text("Loading command: #{command_name} (#{e.class})\n\t#{e}")
|
||||||
|
@ -70,7 +70,7 @@ module Kernel
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Kernel.send(:gem, spec.name, Gem::Requirement.default_prerelease)
|
Kernel.send(:gem, spec.name, Gem::Requirement.default_prerelease)
|
||||||
rescue Exception
|
rescue StandardError
|
||||||
RUBYGEMS_ACTIVATION_MONITOR.exit
|
RUBYGEMS_ACTIVATION_MONITOR.exit
|
||||||
raise
|
raise
|
||||||
end unless resolved_path
|
end unless resolved_path
|
||||||
|
@ -200,7 +200,7 @@ class Gem::Indexer
|
|||||||
rescue SignalException
|
rescue SignalException
|
||||||
alert_error "Received signal, exiting"
|
alert_error "Received signal, exiting"
|
||||||
raise
|
raise
|
||||||
rescue Exception => e
|
rescue StandardError => e
|
||||||
msg = ["Unable to process #{gemfile}",
|
msg = ["Unable to process #{gemfile}",
|
||||||
"#{e.message} (#{e.class})",
|
"#{e.message} (#{e.class})",
|
||||||
"\t#{e.backtrace.join "\n\t"}"].join("\n")
|
"\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)."
|
warn "[#{file}] isn't a Gem::Specification (#{_spec.class} instead)."
|
||||||
rescue SignalException, SystemExit
|
rescue SignalException, SystemExit
|
||||||
raise
|
raise
|
||||||
rescue SyntaxError, Exception => e
|
rescue SyntaxError, StandardError => e
|
||||||
warn "Invalid gemspec in [#{file}]: #{e}"
|
warn "Invalid gemspec in [#{file}]: #{e}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
TestGem::TEST_PLUGIN_EXCEPTION = :loaded
|
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
|
util_remove_interrupt_command
|
||||||
|
|
||||||
# Should attempt to cause an Exception
|
# Should attempt to cause an Exception
|
||||||
with_plugin("exception") { Gem.load_env_plugins }
|
with_plugin("scripterror") { Gem.load_env_plugins }
|
||||||
begin
|
begin
|
||||||
assert_equal :loaded, TEST_PLUGIN_EXCEPTION
|
assert_equal :loaded, TEST_PLUGIN_EXCEPTION
|
||||||
rescue StandardError
|
rescue StandardError
|
||||||
|
@ -41,7 +41,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
|||||||
assert_match(/Finished/, output)
|
assert_match(/Finished/, output)
|
||||||
assert_match(/release/, output)
|
assert_match(/release/, output)
|
||||||
assert_ffi_handle bundle, "Init_rust_ruby_example"
|
assert_ffi_handle bundle, "Init_rust_ruby_example"
|
||||||
rescue Exception => e
|
rescue StandardError => e
|
||||||
pp output if output
|
pp output if output
|
||||||
|
|
||||||
raise(e)
|
raise(e)
|
||||||
@ -67,7 +67,7 @@ class TestGemExtCargoBuilder < Gem::TestCase
|
|||||||
assert_ffi_handle bundle, "hello_from_rubygems"
|
assert_ffi_handle bundle, "hello_from_rubygems"
|
||||||
assert_ffi_handle bundle, "hello_from_rubygems_version"
|
assert_ffi_handle bundle, "hello_from_rubygems_version"
|
||||||
refute_ffi_handle bundle, "should_never_exist"
|
refute_ffi_handle bundle, "should_never_exist"
|
||||||
rescue Exception => e
|
rescue StandardError => e
|
||||||
pp output if output
|
pp output if output
|
||||||
|
|
||||||
raise(e)
|
raise(e)
|
||||||
|
@ -1158,7 +1158,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|||||||
server.ssl_context.tmp_dh_callback = proc { TEST_KEY_DH2048 }
|
server.ssl_context.tmp_dh_callback = proc { TEST_KEY_DH2048 }
|
||||||
t = Thread.new do
|
t = Thread.new do
|
||||||
server.start
|
server.start
|
||||||
rescue Exception => ex
|
rescue StandardError => ex
|
||||||
puts "ERROR during server thread: #{ex.message}"
|
puts "ERROR during server thread: #{ex.message}"
|
||||||
raise
|
raise
|
||||||
ensure
|
ensure
|
||||||
@ -1210,7 +1210,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|||||||
end
|
end
|
||||||
th = Thread.new do
|
th = Thread.new do
|
||||||
s.start
|
s.start
|
||||||
rescue Exception => ex
|
rescue StandardError => ex
|
||||||
abort "ERROR during server thread: #{ex.message}"
|
abort "ERROR during server thread: #{ex.message}"
|
||||||
ensure
|
ensure
|
||||||
s.shutdown
|
s.shutdown
|
||||||
|
Loading…
x
Reference in New Issue
Block a user