Error Messages

And what exactly do we learn from this?
A generation has grow up with either the blue screen of death or the whirly beach ball of death. A minority with unix error messages.

The blue screen means one thing. Something went wrong.

Something.

Could be anything.

So what comes next? What do you do about this? You restart the computer, grab the backup and cuddle it, hoping it or the computer's hard disk are ok.

The problem with the blue screen of death is that an archetypal shit error message. It doesn't help.

Error messages should do one of two things: help the user and help the coder.

For the error message to help the user, it needs to tell them what to do next and it needs to give them a safe way out. I heard of an early software QA engineer who would routinely hit keys randomly when a dialogue box came up because, he said software should be able to fuck things up for you that badly. Users can't be trusted, so don't let them irreversibly screw up their data just because you trusted them.

Thats the user: give them a safe next step. Say "something went wrong - try this or give us a call". Don't tell the end user error 26xf9 occurred, because frankly, my dear, they don't give a damn. They just want your software to work.

And then there's the second audience of your error messages. Coders. This is an odd audience because it might include someone you know very well.

You.

If you write some code today, chances are that in a couple of years you'll see it go wrong and be on the receiving end of your own error message. One such wonderful and annoying example was some code I wrote roughly I-can't-remember years ago which, for a good 5 years would send me an email when something happened with the line number, date and my name.

You will hate yourself if you don't write good error messages.

So, what makes a good error message?

As for the user, give the coder what comes next. If the error is an API error, which will be true for many closed-source systems, provide a link to documentation or at least some hint like.

you should pass theFunction([1,2,3])

If it's a more fundamental error, such as file permissions or the network access of the program, give the user a link to the FAQ or basic requirements of the system. Don't say:

System cannot communication with superstructurecrap

...without explaining everything the system has to communicate with.