mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Reword the message
For errors that could happened while loading `rubygems/defaults/operating_system`
6e1e2141f8
This commit is contained in:
parent
7d859489e1
commit
34e073c0ca
Notes:
git
2021-08-31 19:07:09 +09:00
2 changed files with 11 additions and 2 deletions
|
@ -1333,7 +1333,12 @@ begin
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
# Ignored
|
# Ignored
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
raise e.class, "#{e.message}\nThis is not expected so please report this issue to your OS support and ask for help."
|
msg = "#{e.message}\n" \
|
||||||
|
"Loading the rubygems/defaults/operating_system.rb file caused an error. " \
|
||||||
|
"This file is owned by your OS, not by rubygems upstream. " \
|
||||||
|
"Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
|
||||||
|
"the problem and ask for help."
|
||||||
|
raise e.class, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -15,7 +15,11 @@ class GemTest < Gem::TestCase
|
||||||
|
|
||||||
output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip
|
output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip
|
||||||
assert !$?.success?
|
assert !$?.success?
|
||||||
assert_includes output, "This is not expected so please report this issue to your OS support and ask for help"
|
assert_includes output, "unterminated string meets end of file (SyntaxError)"
|
||||||
|
assert_includes output, "Loading the rubygems/defaults/operating_system.rb file caused an error. " \
|
||||||
|
"This file is owned by your OS, not by rubygems upstream. " \
|
||||||
|
"Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
|
||||||
|
"the problem and ask for help."
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue