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
Closed

Comments

@arielvalentin
Copy link

@arielvalentin arielvalentin commented Sep 22, 2013

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 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 Feb 17, 2017
@arielvalentin
Copy link
Author

@arielvalentin arielvalentin commented Feb 17, 2017

Thanks @enebo!

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.