fix: require button click to trigger intentional test exception#6752
Merged
FireLemons merged 1 commit intorubyforgood:mainfrom Mar 8, 2026
Merged
fix: require button click to trigger intentional test exception#6752FireLemons merged 1 commit intorubyforgood:mainfrom
FireLemons merged 1 commit intorubyforgood:mainfrom
Conversation
Previously, visiting /error immediately raised a StandardError. Now the page renders with a button that must be clicked to trigger the exception, preventing accidental error reports. Resolves rubyforgood#6749
5a443b0 to
df511e5
Compare
Collaborator
|
Thanks. A bot kept posting the url and the link was visited for embeds which kept generating exceptions which made the bot report the link in a post causing a loop. |
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.
What changed
Resolves #6749
Previously, visiting
/errorimmediately raised aStandardError, meaning the error page view never actually rendered. Now the page renders with a button that must be clicked to trigger the exception.Changes
ErrorController:indexaction now renders the page; newcreateaction raises the exceptionconfig/routes.rb: AddedPOST /errorroute for the button actionapp/views/error/index.html.erb: Updated view with a "Trigger Exception" buttonspec/requests/error_spec.rb: Updated tests — GET renders successfully, POST raises the exceptionProof