Interrupt ignores exception message #4286

Closed
jeremyevans opened this Issue Nov 14, 2016 · 4 comments

Projects

None yet

3 participants

@jeremyevans
Contributor

Environment

jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 OpenJDK 64-Bit Server VM 25.72-b15 on 1.8.0_72-b15 +jit [OpenBSD-x86_64]

Expected Behavior

With code:

$ jruby -e 'begin; raise Interrupt, "foo"; rescue Exception; puts $!.message; end'

I expect output will be foo, as that is MRI's behavior and the behavior of earlier JRuby versions. Example with ruby 2.3:

$ ruby23 -e 'begin; raise Interrupt, "foo"; rescue Exception; puts $!.message; end'
foo

Actual Behavior

$ jruby -e 'begin; raise Interrupt, "foo"; rescue Exception; puts $!.message; end'
Interrupt

While I'm understandably not relying on this behavior in production, it did break Sequel's tests. I believe this behavior changed between 9.1.5.0 and 9.1.6.0.

@enebo enebo added this to the JRuby 9.1.7.0 milestone Nov 14, 2016
@headius
Member
headius commented Nov 14, 2016

Weird.

@enebo
Member
enebo commented Nov 14, 2016

Single arg works as expected:

jruby -e 'begin; raise "foo"; rescue Exception; puts $!.message; end'
@jeremyevans
Contributor

This appears to be specific to Interrupt, as raise "foo" (StandardError), and raise Exception, "foo" both work correctly.

@enebo enebo closed this in ddbc53b Nov 30, 2016
@enebo
Member
enebo commented Nov 30, 2016

Looks like we were not calling the new RubySignalException classes version of initialize and therefore were not setting the message. raise on down seems like it could use some cleanup. I found figuring this out above average difficulty...

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