What techniques can I use to always display user friendly error messages? I guess I'm looking for programming, testing, and management techniques that produce user friendly messages.
This is just one part of it, but I recommend using TDD (test driven development). Write tests that expose errors and make sure that the program responds in the correct fashion.
To put it another way, emphasize the importance of error messages by making them part of your user stories.