Total elimination of errors not always desirable:
Users may feel constrained/frustrated by
perceived lack of functionality
Opportunity to learn about the system model removed
Clear, comprehensible errors should be provided with
easy error recovery; example: UNDO.
Error messages, offer user two possibilities:

The user has made an error, describe it.
The system has made an error, describe that.
Both offer solutions to the problem