Handling Server Errors the Right Way™

Handling server errors gracefully and displaying a friendly message to users is often overlooked. Google doesn’t, and displays a more or less understandable message to its users. Including funny artwork of a broken robot.

Google Server Error 502

The three important rules for handling server errors

Note that these rules not only apply to server errors, but any kind of error.

1. Prevent errors

If possible in any way, try to prevent errors. Re-direct moved content to its new location. Catch exceptions. Monitor your application. Test, test, test.

2. Handle errors gracefully

There will always be errors that you can’t prevent. If this happens make sure you handle it gracefully. Make clear in plain text English that something went wrong and what the user can do to continue doing what he wants to do.

3. Keep track of errors

When handling errors gracefully and displaying a nice error message to your users, make sure that you keep track of what happened. Log application exceptions. Save your server logs. Pretend you’re an FAA officer researching a plane crash to make sure the same crash reason won’t happen again.

Write a Comment



  • Designing Beautiful Errors - Vincent van Scherpenseel on UX & Web

    […] errors and give immediate feedback Rule #1 requires us to prevent errors as much as possible. A default value can help a lot, as it shows the […]

  • Leverage your error reports - Vincent van Scherpenseel on UX & Web

    […] Google Chrome definitely falls in this category) you should take advantage of that. As I wrote recently you need to keep track of all error reports. If you get a lot of them (and fixing the error is out […]