[rubygems/rubygems] Improve Bundler::GenericSystemCall error message

https://github.com/rubygems/rubygems/commit/ccd7e084a8
This commit is contained in:
David Rodríguez 2024-10-21 19:29:12 +02:00 committed by git
parent cc29d737ef
commit 055ed5f592
2 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ module Bundler
rescue Errno::EEXIST, Errno::ENOENT
raise
rescue SystemCallError => e
raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.")
raise GenericSystemCallError.new(e, "There was an error #{[:create, :write].include?(action) ? "creating" : "accessing"} `#{path}`.")
end
def major_deprecation(major_version, message, removed_message: nil, print_caller_location: false)

View File

@ -513,7 +513,7 @@ RSpec.describe Bundler::SharedHelpers do
it "raises a GenericSystemCallError" do
expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error(
Bundler::GenericSystemCallError, /error accessing.+underlying.+Shields down/m
Bundler::GenericSystemCallError, /error creating.+underlying.+Shields down/m
)
end
end