exceptions thrown by Ruby not propagated to calling Ruby when some Java involved in between #2232
It seems that exceptions thrown by Ruby code are not propagated to the calling Ruby method when some Java code is involved in between.
Run the test:
$ git clone firstname.lastname@example.org:gmalkas/jruby-uncaught-exception-issue.git && cd jruby-uncaught-exception-issue $ bundle && ./not_working.rb
The previous code should print
On the other hand, if the rescuing Ruby code is calling the failing code directly (without involving Java code), it works as expected: https://github.com/gmalkas/jruby-uncaught-exception-issue/blob/master/working.rb
Let me know if you need any additional information.
The text was updated successfully, but these errors were encountered:
…ruby#2232) this no longer makese sense - and leads to confusing behavior when Ruby objects are used within Java (delegating to <=> which might be user-defined) every-one is expected to handle <=> on 1.9 (and return nil if not comparable) on 1.8 we still swallow a NoMethodError as Object does not provide <=>
* jruby-1_7: some more comparable asserts including for the Java compareTo part native RubySymbol#compareTo since we expect to always be able to sort should not-rewrite jump exceptions twice as well (not just raise ones) delete un-used imports [ji] do not rewrite stack-trace twice for Ruby (raise) exceptions base compareTo should not silence all Ruby raised exceptions (fixes #2232) re-arrange rescue spec (we're about to spec some more behavior) only test nil return from Object cmp on 1.9 (on 1.8.7 its expected to raise) more of correct $! restore + use get/setErrorInfo for better predictability another incorrect $! with numeric coercion on <=> + cleanup getRuntime() Fix some consumers for #1601. Don't leak out if we are swallowing the raised exception Conflicts: core/src/main/java/org/jruby/Main.java core/src/main/java/org/jruby/RubyBasicObject.java core/src/main/java/org/jruby/RubyClass.java core/src/main/java/org/jruby/RubyComparable.java core/src/main/java/org/jruby/RubyNumeric.java core/src/main/java/org/jruby/RubySymbol.java core/src/main/java/org/jruby/RubyTime.java core/src/main/java/org/jruby/javasupport/JavaCallable.java