-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Display exception messages using simple_format #40567
Conversation
06bbaa9
to
b3b7ba7
Compare
When you are done, can you please post screeshots of before and after? |
b3b7ba7
to
618d0ae
Compare
exception message.
618d0ae
to
93f0ceb
Compare
@@ -299,7 +300,7 @@ def foo | |||
app("development") | |||
get "/rails/mailers/notifier" | |||
assert_predicate last_response, :not_found? | |||
assert_match "Mailer preview 'notifier' not found", last_response.body | |||
assert_match "Mailer preview 'notifier' not found", h(last_response.body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately without this change, this test was failing on rails 2.7. If I updated to "Mailer preview 'notifier' not found"
this test failed on rails 2.6.5
Example of test failure without this change on 2.7
Failure:
ApplicationTests::MailerPreviewsTest#test_mailer_preview_not_found [test/application/mailer_previews_test.rb:303]:
Expected /Mailer\ preview\ &\#39;notifier&\#39;\ not\ found/ to match # encoding: ASCII-8BIT
Html from mailer (snipped)
<h1>Unknown action</h1>\n</header>\n<div id=\"container\">\n <div class=\"exception-message\">\n <div class=\"message\">Mailer preview 'notifier' not found</div>\n </div>\n\n</div>\n\n\n</body>\n</html>\n".
Display exception messages using simple_format
Summary
Currently error messages are displayed all in one line in the error pages, in the rails console/logs they appear nicely on multiple lines, making it easier to grok. With this PR I want to propose that we display error messages in the view on multiple lines making it easier for developers to read the error messages.
These changes were pulled out from #39723
Before:
After: