forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ArgumentErrors raised during template rendering
Argument errors related to strict locals in templates now raise an `ActionView::StrictLocalsError`, and all other argument errors are reraised as-is. Previously, any `ArgumentError` raised during template rendering was swallowed during strict local error handling, so that an `ArgumentError` unrelated to strict locals (e.g., a helper method invoked with incorrect arguments) would be replaced by a similar `ArgumentError` with an unrelated backtrace, making it difficult to debug templates. Now, any `ArgumentError` unrelated to strict locals is reraised, preserving the original backtrace for developers. Also note that `ActionView::StrictLocalsError` is a subclass of `ArgumentError`, so any existing code that rescues `ArgumentError` will continue to work. Fixes rails#52227
- Loading branch information
1 parent
d1f913c
commit 68302c6
Showing
4 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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