views:

92

answers:

3

In my web site, I am currently custom handling two HTTP errors: 404 Not Found and 403 Forbidden. This "handling" consists of redirecting the user to a custom error page specific to the particular error. Are there any other HTTP (or, in fact, other kinds) errors that occur often enough to warrant a custom redirect and page?

+2  A: 

I would handle the 500 error page to be more friendly, like Stackoverflow does: http://stackoverflow.com/error

Tom Ritter
+2  A: 

If you want to be relatively thorough, you can consider handling these two:

  • 401: Unauthorized. You didn't recognize the login attempt. (Contrast with 403, where they do authenticate successfully but don't have permission to see the resource they asked for.)

  • 500: Server Error. Something went wrong server-side and you couldn't recover from it.

If you expect to get a lot of traffic, perhaps also consider handling 503:

  • 503: Service Unavailable. The server got your request but is too busy to handle it right now.
John Feminella
I've always been nervous about custom handling of 401 since it is used to trigger authentication via WWW-Authenticate. Though the RFC does recommend that the user agent present the content if authentication was attempted previously so it might make sense.
D.Shawley
A: 

I'm using ruby on rails and by default it helps you handling these:

  • 404: Not found

  • 422: Unprocessable Entity

  • 500: Server error

I then usually add handling for 403: Forbdiden

marcgg