ruichen199801 / forxnews

CIS550 database course project
https://youtu.be/nuDBwg3mG6o
0 stars 1 forks source link

[Improvement] Handle Route No Match #31

Closed ruichen199801 closed 1 year ago

ruichen199801 commented 1 year ago

We can redirect the user to landing page (/) if they go to a route that doesn't exist, and send them an error message.

For better user experience, we can create a 404 not found page when the route doesn't have any matches, like <Route path="*" element={<PageNotFound />} />.

ruichen199801 commented 1 year ago

Now user will be shown an error message and get directed to landing page if:

User will be directed to 404 page without an error message if:

It's not necessary to have an exception page for other http error responses such as 500, in which case we expect the app to direct user to landing page.