Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
If you pass multiple exception classes to a rescue class and are running in interpreted mode, Java exceptions can only be rescued if first in the list.
Example code to reproduce:
require 'java'
begin
java.sql.DriverManager.getConnection('jdbc:mysql:blah')
rescue StandardError, java.sql.SQLException => e
puts "Caught exception"
end
That should print "Caught exception" but instead prints the stack trace when run as "jruby -X-C rescue.rb". If you reverse the order of the rescue arguments, it prints "Caught exception" as expected.
Pull request submitted - https://github.com/jruby/jruby/pull/157