summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-02-11 16:06:06 +0900
committerHomu <homu@barosl.com>2016-02-11 16:06:06 +0900
commite76760d1a492cf457a9952da2e5c24a3ba50b51d (patch)
tree3a5a2f815f4742d95886f50f8ad1bf605f335a4c /lib
parent1c2710639ccd8558c8467bb3cd2f95548306bc31 (diff)
parent57af37d4748df9473aa1295fe20711ffd96c5097 (diff)
downloadbundler-e76760d1a492cf457a9952da2e5c24a3ba50b51d.tar.gz
Auto merge of #4292 - RochesterinNYC:add-error-message-for-shared-helpers-EPROTO, r=indirect
Raise new `Bundler::VirtualProtocolError` in response to `Errno::EPROTO` - Related to #4163, #3932, and #3581 Ideally, a custom error and/or error message would be returned in these cases rather than just error out because of the uncaught `Errno::EPROTO`. I'd like some feedback on what the appropriate error message should be however. The caveat is that it seems like a wide range of errors (possibly any error?) that occur in the presence of virtualization will raise this `Errno::EPROTO` error.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/errors.rb9
-rw-r--r--lib/bundler/shared_helpers.rb2
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/bundler/errors.rb b/lib/bundler/errors.rb
index eec8d00ef5..7b893e664f 100644
--- a/lib/bundler/errors.rb
+++ b/lib/bundler/errors.rb
@@ -98,4 +98,13 @@ module Bundler
status_code(26)
end
+
+ class VirtualProtocolError < BundlerError
+ def message
+ "There was an error relating to virtualization and file access." \
+ "It is likely that you need to grant access to or mount some file system correctly."
+ end
+
+ status_code(27)
+ end
end
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 654359d1ed..c79c88c5e1 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -107,6 +107,8 @@ module Bundler
raise PermissionError.new(path, action)
rescue Errno::EAGAIN
raise TemporaryResourceError.new(path, action)
+ rescue Errno::EPROTO
+ raise VirtualProtocolError.new
end
def const_get_safely(constant_name, namespace)