Skip to content

Implement Java::JavaLang::Throwable#full_message#5908

Merged
headius merged 1 commit intojruby:masterfrom
davishmcclurg:throwable-full-message
Oct 8, 2019
Merged

Implement Java::JavaLang::Throwable#full_message#5908
headius merged 1 commit intojruby:masterfrom
davishmcclurg:throwable-full-message

Conversation

@davishmcclurg
Copy link
Contributor

Since Java throwables are treated similarly to regular Ruby exceptions,
I think it makes sense to implement full_message for easier logging
and debugging.

This moves the RubyException implementation to TraceType so that it
can be shared with Throwable. I had to change the exception argument
type in printBacktraceMRI in order to support the exception-like
object that Throwable provides.

Closes: #5906

Since Java throwables are treated similarly to regular Ruby exceptions,
I think it makes sense to implement `full_message` for easier logging
and debugging.

This moves the `RubyException` implementation to `TraceType` so that it
can be shared with `Throwable`. I had to change the `exception` argument
type in `printBacktraceMRI` in order to support the exception-like
object that `Throwable` provides.

Closes: jruby#5906
@headius
Copy link
Member

headius commented Oct 8, 2019

The original intent of actually propagating Java exceptions was indeed to make them duck type as Ruby exceptions, so this makes sense.

@headius headius added this to the JRuby 9.2.9.0 milestone Oct 8, 2019
@headius
Copy link
Member

headius commented Oct 8, 2019

Looks good to me. The whitespace changes are a little annoying, but the whitespace that was there shouldn't have been. If you do any future PRs, try to keep the whitespace changes in a separate commit, so they don't show up in git blame as being related to the actual change.

Thank you for the patch!

@headius headius merged commit 80455ae into jruby:master Oct 8, 2019
@davishmcclurg davishmcclurg deleted the throwable-full-message branch October 8, 2019 16:47
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

Successfully merging this pull request may close these issues.

Java::JavaLang::Throwable missing full_message method

2 participants