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

Feat: system enrollment error - 500 error when linking #2088

Merged
merged 8 commits into from May 20, 2024

Conversation

angela-tran
Copy link
Member

Part of #2032

This PR implements the system enrollment error page template and adds error-handling to the benefits.enrollment.views.index function so that if a 500-level HTTP error occurs when we try to link a funding source to a group, the system enrollment error page will be shown. The CTA takes the user back to the agency index.

A Sentry notification will be sent - see an example from my testing. Note: since I don't know how to cause an actual 500 error with the linking endpoint, I had to add some code locally to fake it (more details in steps for reviewing / testing).

Screenshots

Expand
Desktop Mobile
image image
image image

Steps for reviewing / testing

To simulate a 500-level HTTP error, I added this to my index function:

       try:
+           class response:
+               def __init__(self):
+                   self.status_code = 500
+           raise HTTPError(response=response())
            client.link_concession_group_funding_source(funding_source_id=funding_source.id, group_id=eligibility.group_id)
        except HTTPError as e:

Then run through a Login.gov flow and non-Login.gov flow all the way through enrollment as normal to see the system enrollment error page.

@angela-tran angela-tran self-assigned this May 13, 2024
@angela-tran angela-tran requested a review from a team as a code owner May 13, 2024 22:31
@github-actions github-actions bot added back-end Django views, sessions, middleware, models, migrations etc. front-end HTML/CSS/JavaScript and Django templates tests Related to automated testing (unit, UI, integration, etc.) deployment-dev [auto] Changes that will trigger a deploy if merged to dev and removed front-end HTML/CSS/JavaScript and Django templates tests Related to automated testing (unit, UI, integration, etc.) labels May 13, 2024
Copy link

github-actions bot commented May 13, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits/enrollment
  views.py
Project Total  

This report was generated by python-coverage-comment-action

@angela-tran
Copy link
Member Author

angela-tran commented May 14, 2024

I forgot to run ./bin/makemessages.sh! Commit incoming

@angela-tran angela-tran changed the title Chore: system enrollment error - 500 error when linking Feat: system enrollment error - 500 error when linking May 14, 2024
@thekaveman thekaveman force-pushed the chore/system-enrollment-error--500-link branch from 8d55183 to cf205c1 Compare May 20, 2024 16:47
@thekaveman
Copy link
Member

I rebased on dev to clean up conflicts in the PO files

@thekaveman thekaveman force-pushed the chore/system-enrollment-error--500-link branch from fdff7c2 to fa77a8e Compare May 20, 2024 21:52
@thekaveman
Copy link
Member

Rebased on dev one more time to resolve conflicts with #2067, and added the Spanish translations for this page.

I also updated the page title in English and Spanish using the latest from the copy spreadsheet.

@thekaveman thekaveman force-pushed the chore/system-enrollment-error--500-link branch from fa77a8e to 95ec106 Compare May 20, 2024 21:59
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

I was able to trigger the error using the suggested code edit, and then confirmed that the Sentry and Amplitude events were sent, copy is correct, and the CTA takes the user back to the agency homepage.

@thekaveman thekaveman merged commit 1a15409 into dev May 20, 2024
11 checks passed
@thekaveman thekaveman deleted the chore/system-enrollment-error--500-link branch May 20, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc. deployment-dev [auto] Changes that will trigger a deploy if merged to dev front-end HTML/CSS/JavaScript and Django templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants