Redirect to Error page on 5XX or 404 API responses
As a user
interacting with the application,
I want to be redirected to a designated error page
if any API request returns a 5XX or 404 error,
so that I am informed of the issue with clear guidance
instead of seeing incomplete or broken content.
Background
To improve user experience, the application should handle 5XX responses from the API by redirecting users to the error page. This redirection will ensure that users receive a consistent and informative response when encountering server-side issues, rather than experiencing broken functionality. A Cypress test is required to confirm this behavior.
Acceptance Criteria
-
Implement logic in the frontend to detect 5XX or 404 responses from API requests and redirect users to the error page. -
Ensure the redirection to the error page placeholder is triggered for any API request returning a 5XX or 404 status code. -
A Cypress test is created to validate that any 5XX or 404 response from the API results in a redirection to the error page. -
Confirm that no cyclic redirects or console errors are introduced by this error handling.
Edited by Mike Knee