What's a good error message?

In general, when writing code for handling the case for when something goes wrong, the programmer's natural instinct seems to be to just get over with it as soon as is possible and move on to other more exciting things. I speak, of course, from first hand experience. Now, there are a class of errors for which even the programmer is at a loss for providing guidance on what is an appropriate recourse, but really, if one is honest with oneself they are in truth few and far between. If you're willing to put in the effort required, more often than not, an error message that allows the end user to actually do something about the problem is only a few minutes and a few key strokes away.

I was working with SQL Server Management Studio Express edition today when I came across this error:

SQL Server Management Studio Express Edition - Error message. Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.

I present this as an example of a good error message. I knew exactly what I had to do to remedy the situation once I actually paid attention to what the message said (I admit, however, to having pig-headedly re-tried what I was trying to do a few times, unabashedly dismissing this message box every time, before admitting defeat and reading the message!). I did what this message box told me to do and the thing just worked! This might not sound like a big deal, but it makes me that little bit happier and as Joel puts it, these tiny victories tend to add up and contributes to one's feeling positively disposed towards the product at a subconcious level!

comments powered by Disqus