From 54277498e7e4b6a1d4a08c59a3072abf0955ba1b Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Sun, 20 Sep 2026 12:22:59 +0200 Subject: [PATCH] Remove extra warning when require fails This warning about a failed jar load is next to both * a debug of the original error * a re-raise of the original error as a JarLoadError I think it's unnecessary to also do a non-verbose warning about the failed load. The debug could possibly become a verbose warning, but an uncaught raised exception would log everything necessary and a caught raised exception probably indicates the caller does not want to see output. Fixes jruby/jar-dependencies#112 --- lib/jar_dependencies.rb | 1 - specs/jars_spec.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/jar_dependencies.rb b/lib/jar_dependencies.rb index 61a7dbd..f16e65d 100644 --- a/lib/jar_dependencies.rb +++ b/lib/jar_dependencies.rb @@ -380,7 +380,6 @@ def do_require(group_id, artifact_id, version, classifier) require jar end rescue LoadError => e - Jars.warn "failed to load jar: #{jar} (#{e.message})" Jars.debug(e) raise JarLoadError, "failed to load jar: #{jar}; run `lock_jars` or reinstall the gem" end diff --git a/specs/jars_spec.rb b/specs/jars_spec.rb index 9334c99..c2cfb91 100644 --- a/specs/jars_spec.rb +++ b/specs/jars_spec.rb @@ -195,7 +195,6 @@ def fake.lock_down(...) _(error).must_be_kind_of LoadError _(error.message).must_equal 'failed to load jar: org/something/slf4j-simple/1.6.6/slf4j-simple-1.6.6.jar; ' \ 'run `lock_jars` or reinstall the gem' - _($stderr.string).must_include 'failed to load jar: org/something/slf4j-simple/1.6.6/slf4j-simple-1.6.6.jar' ensure $stderr = STDERR end