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

Support Exception#detailed_message #761

Merged
merged 3 commits into from
Dec 19, 2022

Conversation

imjoehaines
Copy link
Contributor

Goal

This was added in Ruby 3.2 for things like 'did_you_mean' that annotate existing exception messages

Currently the annotations are included in Exception#message, but when Ruby 3.2 releases they will move to Exception#detailed_message so we need to use the new method to keep the existing behaviour

@imjoehaines imjoehaines changed the title Support exception detailed message Support Exception#detailed_message Dec 19, 2022
@imjoehaines imjoehaines force-pushed the support-exception-detailed-message branch from a9306c6 to c38675c Compare December 19, 2022 11:43
@imjoehaines imjoehaines changed the base branch from next to fix-mailman-fixture December 19, 2022 11:43
Base automatically changed from fix-mailman-fixture to next December 19, 2022 12:02
@imjoehaines imjoehaines force-pushed the support-exception-detailed-message branch from c38675c to 164b76a Compare December 19, 2022 12:02
This was added in Ruby 3.2 for things like 'did_you_mean' that annotate
existing exception messages

Currently the annotations are included in Exception#message, but when
Ruby 3.2 releases they will move to Exception#detailed_message so we
need to use the new method to keep the existing behaviour
This shouldn't happen in practice but we should be safe to protect
against invalid definitions of detailed_message

It's also possible someone has implemented this method on Ruby versions
< 3.2 where there isn't an expectation to have a highlight parameter as
it wasn't a standard Exception method
@imjoehaines imjoehaines force-pushed the support-exception-detailed-message branch from 164b76a to 8a34d93 Compare December 19, 2022 12:03
@imjoehaines imjoehaines marked this pull request as ready for review December 19, 2022 13:59
@imjoehaines imjoehaines merged commit b6b7f6d into next Dec 19, 2022
@imjoehaines imjoehaines deleted the support-exception-detailed-message branch December 19, 2022 14:55
@imjoehaines imjoehaines mentioned this pull request Jan 4, 2023
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.

2 participants