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

EL-1902: Handle LAALAA 404s #384

Closed
wants to merge 1 commit into from
Closed

EL-1902: Handle LAALAA 404s #384

wants to merge 1 commit into from

Conversation

HettieS
Copy link
Contributor

@HettieS HettieS commented Dec 3, 2024

What does this pull request do?

This PR does two things:

  • raises a 404 error page when a user tries to access a page in the pagination that does not exist (via manipulating the URL)
  • fixes two pagination issues: one cosmetic issue where we were displaying '1' at the bottom of the page when there was only one page, and a bigger issue where we were generating an additional, unnecessary page at the end of the pagination that created a 404 in LAALAA and subsequently a 500 in FALA (now would be 'Page not found' and we wouldn't see an error).

I targeted only handling 404s differently as I don't know enough yet about other errors and the data structure that might come from LAALAA. Error handling is done quite weirdly, and the form is weirdly linked into the data response so haven't touched that. Most sensible place to raise 404 felt like the view given the current code structure.

Previously, 404s were being passed down to the forms/view weirdly, which meant the view was receiving no data structure - so everything blew up at the point of pagination. Have made the movement of data more sensible and now catching the 'Invalid page' with the 404.

Any other changes that would benefit highlighting?

Needs some good UAT to make sure I haven't inadvertently broken how other errors are returned and to make sure pagination works as expected.

Checklist

  • Provided JIRA ticket number in the title, e.g. "LGA-152: Sample title"

@HettieS HettieS requested a review from a team as a code owner December 3, 2024 19:19
@psweeting1
Copy link
Contributor

Is it possible to do a test where we alter the page URL param to trigger the old 500 issue we were facing?

Copy link
Contributor

@psweeting1 psweeting1 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Dec 11, 2024

@HettieS HettieS mentioned this pull request Dec 11, 2024
1 task
@HettieS HettieS closed this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants