Skip to content

exceptions thrown by Ruby not propagated to calling Ruby when some Java involved in between #2232

@gmalkas

Description

@gmalkas

It seems that exceptions thrown by Ruby code are not propagated to the calling Ruby method when some Java code is involved in between.

Proof of concept: https://github.com/gmalkas/jruby-uncaught-exception-issue/blob/master/not_working.rb

Run the test:

  $ git clone git@github.com:gmalkas/jruby-uncaught-exception-issue.git && cd jruby-uncaught-exception-issue
  $ bundle && ./not_working.rb

The previous code should print Rescued StandardError twice but does not.

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

Version information: jruby 1.7.16 (1.9.3p392) 2014-09-25 575b395 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_25-b17 +jit [linux-amd64]

Let me know if you need any additional information.

Thank you!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions