Skip to main content

Error Messages

Published: November 03, 2008

This is one of the simplest and best tips I've ever seen. If there is one thing that every software engineer needs to know, this is it:

From the book: Interaction Design: Beyond Human - Computer Interaction

Ideally, error messages should be treated as how-to-fix-it messages

It's so simple, so easy to do. It's also something that is almost always done wrong. How many times have you debugged software that was throwing a message like "file not found" or "syntax error?"

Bad error messages are endemic, and it doesn't have to be that way! For example, when using Oracle's database software, I often see this message:

PLS-00306: wrong number or types of arguments in call

The last time I saw this message, there were 42 parameters. Which one was wrong?? Imagine how much money Oracle could save every company that uses their software by changing the error message to read:

PLS-00306: wrong number or types of arguments in call.
The parameter p_thingOne of type NUMBER(9,0) is missing.
Additionally, an unexpected parameter, pthingOnE is present.

Now instead of needing to guess what went wrong, it is possible to immediately know the source of the problem without spending precious time!