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

Interrupt ignores exception message #4286

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

Interrupt ignores exception message #4286

jeremyevans opened this issue Nov 14, 2016 · 4 comments
Milestone

Comments

@jeremyevans
Copy link
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
Copy link
Member

headius commented Nov 14, 2016

Weird.

@enebo
Copy link
Member

enebo commented Nov 14, 2016

Single arg works as expected:

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

@jeremyevans
Copy link
Contributor Author

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

@enebo enebo closed this as completed in ddbc53b Nov 30, 2016
@enebo
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants