After a technical blog post on database, let's change a little bit for ergonomy : error messages are challenging for the User Experience ("An unexpected error occurend" is not the best mesage you could have).
On the UXMas advent calendar, an interesting article was published with the title "The 4 H's of Writing Error Messages" and defining the following rule :
Error messages need to be:
- Human : error messages should have been writen to be read by humans and not a robot for a robot
- Helpful : it must be understood by the user (what went wrong ? how can the user recover ?) but also well presented (think of contrast, layout, etc)
- Humorous : a touch of humor may help to smooth this moment of stress/disappointment/... but don't be too humourous !
- Humble : Assume it's not user's fault but your (app or server side) and be humble and mean it. Users are more tolerant when you are transparent/honest with them
Maybe a 5th item which is missing is that you are informed about the issue and that you will investigate user's issue (as long as it's true, remember 4th H). Indeed, being humble and sorry is nice but fixing bugs is better