Skip to content

Commit

Permalink
Fix an incompatibility error when nested LoadError
Browse files Browse the repository at this point in the history
This commit fixes an incompatibility detected by upgrading JRuby version:
#10932

This issue has been reported to jruby/jruby#7316.
  • Loading branch information
koic committed Aug 17, 2022
1 parent 5d35825 commit 36c487a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rubocop/feature_loader.rb
Expand Up @@ -41,7 +41,9 @@ def load
# https://github.com/rubocop/rubocop/issues/10893
require(namespaced_target)
rescue ::LoadError => error_for_namespaced_target
raise e if error_for_namespaced_target.path == namespaced_target
# NOTE: This wrap is necessary due to JRuby 9.3.4.0 incompatibility:
# https://github.com/jruby/jruby/issues/7316
raise LoadError, e if error_for_namespaced_target.path == namespaced_target

raise error_for_namespaced_target
end
Expand Down

0 comments on commit 36c487a

Please sign in to comment.