How to Write Error Messages

A good error message has three parts:

  1. The problem – explains that an error has happened;
  2. The cause – explains what caused the problem;
  3. The solution – explains how to overcome the problem.

After you ensure your message contains all these three parts, its time to review it. You need to edit it to ensure it:

  1. Is user centred – avoid jargon and words your audience will have an hard time understanding;
  2. Is direct – as William Strunk said, “Put statements in positive form. Avoid tame, colourless, hesitating and non-committal language”;
  3. Omits needless words – cut, cut, cut.

Source: How to Write Error Messages