For example,
1. my site allows user login, if user keys in wrong username/password, display error message, prompt to re-login
2. session exceeds 30mins of inactivity, auto logs out, and user comes back to the computer and tries to navigate, display error message, prompt to re-login
3. database down when try to search any database, redirect to error page, or display error message somehow.
4. access denied, due to lack of sufficient permission to perform action/access a certain page. For example, someone typing in a direct url to my staff pages, fail access check, redirect.
and so on.
I was looking at a website I created 2 years ago and saw this problem of having one error page for one error, ending up with tons of different pages to handle all sorts of error messages. Like I'd have, staff_access_denied.html, not_found.html, failed_connect.html, access_expired.html etc.
Very messy
I was thinking about having one error page, every error redirects to that page, and on that one page, I have a switch to display error messages based on the error code I'd include in the redirected url.
How does that sound? Are there better solutions?
Thanks!