This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2k
When requiring a gem that contains a dash the original exception is swallowed #1807
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should I do something about this? From what I understand, the failing builds are not related to this modification but I'm certainly wrong. |
Intrepidd
added a commit
to Intrepidd/bundler
that referenced
this pull request
Oct 1, 2014
This looks like rubygems#1807 when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file. If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after. However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb' This PR raise the exception back in case it really comes from inside the namespaced file.
Intrepidd
added a commit
to Intrepidd/bundler
that referenced
this pull request
Oct 1, 2014
This looks like rubygems#1807 when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file. If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after. However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb' This PR raise the exception back in case it really comes from inside the namespaced file.
Intrepidd
added a commit
to Intrepidd/bundler
that referenced
this pull request
Oct 1, 2014
This looks like rubygems#1807 when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file. If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after. However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb' This PR raise the exception back in case it really comes from inside the namespaced file.
Intrepidd
added a commit
to Intrepidd/bundler
that referenced
this pull request
Oct 1, 2014
This looks like rubygems#1807 when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file. If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after. However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb' This PR raise the exception back in case it really comes from inside the namespaced file.
Intrepidd
added a commit
to Intrepidd/bundler
that referenced
this pull request
Oct 1, 2014
This looks like rubygems#1807 when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file. If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after. However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb' This PR raise the exception back in case it really comes from inside the namespaced file.
Intrepidd
added a commit
to Intrepidd/bundler
that referenced
this pull request
Oct 2, 2014
This looks like rubygems#1807 when raising a LoadError in a required gem, bundler will rescue it to try and see if it came from his own namespaced require or from the required file. If it comes from the dashed require it will re-raise the original exception in case the gem was dashed but the first require was ok but raised a LoadError after. However, the exception is swallowed if we require a dashed gem without the proper file name, for example gem name : 'foo-bar' and file architecture : 'foo/bar.rb' This PR raise the exception back in case it really comes from inside the namespaced file.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We just had an issue with
Bundler.require
in one of our gems. This one contains a dash but it's not namespaced andBundlder.require
raised aLoadError
complaining about gem/name being not found.The thing is, the "real" error was a typo in one of the required files (one file tried to require something wrong and it failed with a
LoadError
exception). This was next to impossible to catch because the exception that is raised in this case is the secondLoadError
(the gem/name not found one) instead of the original another_gem not found.I've patched
require
to re-raise the original exception in this case. I think it's more logical but I can see where you'd sometimes want to be warned about the namespaced version not found. I don't know how to handle this case properly but as-is it doesn't break anything, aLoadError
is still raised and it's just a matter of displaying the correct information.