Error messages
- Information telling the user what went wrong.
- Information telling the user how he could prevent this problem.
- Information helpful to the developer for debugging.
Developers very often think only about the topic #3, hoping this will help them to fix the problem. But there is no application that is completely without errors at all, so it is very important to give a good description of what went wrong (#1). And to help the user continue to work after the error, it might be helpful to give him a hint on how to procede.
Examples of bad error messages:
Examples of proper error messages:- Error 123: FILE_NOT_FOUND
Speak English (or whatever language your application comes in) and in full sentences instead! - File not found!
Let the user know which file exactly was not found, and what he could try if he really thinks the file would be there, e.g. mapping a networking drive instead of using a UNC path. - Could not open file!
So what? Think about the one or two major reasons for this, and tell the user what he can try to avoid this error, e.g. closing the file in other applications, restart your application, etc.
- Could not open file "x:\something.txt" (error 0815). Please make sure that the file and it's drive are available, and that the file is not opened in any other application currently.
I could go on for a while, but won't, since it's easy once one get used to not just use WriteLn('Error 123'); for debug purposes. For those, write your stuff to a debug pipe instead, where you probably can leave them in you really want to, since they'll show only when using proper debugging tools.

0 Comments:
Post a Comment
<< Home