Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError raised when trying to propagate java Throwables using Thread.raise #1037

Closed
arielvalentin opened this issue Sep 22, 2013 · 2 comments

Comments

@arielvalentin
Copy link

Here is an example script that reproduces the problem:

require 'java'

x = Thread.current
thread = Thread.new {
  begin
    Java::JavaLang::Class.for_name('not_real')
  rescue Java::JavaLang::ClassNotFoundException => e
    x.raise e #results in TypeError
  end
}
sleep 1

Example output:

→ ruby thread_raise_type_error.rb 
TypeError: exception object expected
                    raise at org/jruby/RubyThread.java:858
  chained_1_rescue_line_6 at thread_raise_type_error.rb:8
                   (root) at thread_raise_type_error.rb:6
@enebo enebo added this to the JRuby 9.1.8.0 milestone Feb 17, 2017
@enebo
Copy link
Member

enebo commented Feb 17, 2017

This appears to be have been fixed at some point in the past. Seemingly on both 1.7.x and 9k:

Unhandled Java exception: java.lang.ClassNotFoundException: not_real
java.lang.ClassNotFoundException: not_real

@enebo enebo closed this as completed Feb 17, 2017
@arielvalentin
Copy link
Author

Thanks @enebo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants