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

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

Comments

Projects
None yet
2 participants
@arielvalentin

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

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Feb 17, 2017

Member

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
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 Feb 17, 2017

@arielvalentin

This comment has been minimized.

Show comment
Hide comment

Thanks @enebo!

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