[5.8] Allow rescued exception reporting to be disabled #28617
Merged
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.
The
rescue
helper is definitely one of my favorites and use it a lot for parsing of request query values like dates for example. It's just quite annoying that the exceptions get reported even if I don't care about them at that specific location in my application logic.I know that I can ignore the exception class in the handler, but sometimes the thrown exception still makes sense at other places.
This PR adds an optional boolean to the helper to allow exceptions to be just ignored instead of reporting them by default.