Match Exception#full_message with MRI 3.2#8040
Merged
enebo merged 2 commits intojruby:masterfrom Dec 11, 2023
ntkme:mri-exception-format
Merged
Match Exception#full_message with MRI 3.2#8040enebo merged 2 commits intojruby:masterfrom ntkme:mri-exception-format
Exception#full_message with MRI 3.2#8040enebo merged 2 commits intojruby:masterfrom
ntkme:mri-exception-format
Conversation
Contributor
Author
|
This is the limit test I did: diff <(ruby test.rb) <(./bin/jruby test.rb)
diff <(ruby test.rb 2>/dev/null) <(./bin/jruby test.rb 2>/dev/null)Test script: def recurse(depth, limit)
if depth < limit
recurse(depth + 1, limit)
else
raise 'limit reached'
end
end
begin
recurse(0, 10)
rescue => e
puts e.full_message
puts '---'
puts e.full_message(highlight: nil)
puts '---'
puts e.full_message(order: nil)
puts '---'
puts e.full_message(highlight: nil, order: nil)
puts '---'
puts e.full_message(highlight: nil, order: :top)
puts '---'
puts e.full_message(highlight: nil, order: :bottom)
puts '---'
puts e.full_message(highlight: false, order: nil)
puts '---'
puts e.full_message(highlight: false, order: :top)
puts '---'
puts e.full_message(highlight: false, order: :bottom)
puts '---'
puts e.full_message(highlight: true, order: nil)
puts '---'
puts e.full_message(highlight: true, order: :top)
puts '---'
puts e.full_message(highlight: true, order: :bottom)
end |
Member
|
@ntkme cool. If someone opens an issue about order being wrong then we can reconsider whether we should change it but the fact it has changed in 3.2 means people should not depend on order default anyways. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In my very limited test, this should matches MRI 3.2's formatting at byte level as long as the backtrace is exactly the same. E.g. rescue then re-raise a different error creates an additional line in backtrace for MRI, but not in jruby - the output will be slightly different in such case.
Why match MRI 3.2 not 3.1? The only difference between 3.1 and 3.2 is how
order:works. In 3.2,orderdefault to:top, which is the same as the current jruby behavior. Therefore, matching 3.2 is actually a smaller change than matching 3.1.