Skip to content

Commit de9b235

Browse files
yahondaclaude
andcommitted
Initialize ojdbc_jars before require so LoadError rescue never crashes
If require "java" or require "jruby" raises LoadError, the rescue block below previously referenced the unbound local ojdbc_jars and would itself raise NameError, masking the original error. Hoist the empty-array initialization above the begin so the rescue path always has a safe value to interpolate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 584e78a commit de9b235

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/plsql/jdbc_connection.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ojdbc_jars = []
2+
13
begin
24
require "java"
35
require "jruby"
@@ -11,7 +13,6 @@
1113
java_version.to_i
1214
end
1315

14-
ojdbc_jars = []
1516
ojdbc_jars << "ojdbc17.jar" if java_major >= 17
1617
ojdbc_jars << "ojdbc11.jar" if java_major >= 11
1718
ojdbc_jars << "ojdbc8.jar" if java_major >= 8

0 commit comments

Comments
 (0)