Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
274 views
in Technique[技术] by (71.8m points)

usability - How does one write good error messages?

While this is more of a written language issue than a coding one, it is something that programmers must do in circumstances where copy is not provided by a client or someone else. Any examples of error messages, good or bad, are welcome to make the point.

I briefly searched and could not find a dupe thread. Ok, have at it. Thanks, all.

question from:https://stackoverflow.com/questions/194537/how-does-one-write-good-error-messages

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  • Apologise.
  • Say what went wrong.
  • Say how to resolve it.
  • Be polite.
  • The message should be worded so that the application accepts responsibility for the problem. Never blame or criticize the user or make them think it's their fault.

Example:
"Sorry, the file could not be opened. Please check that the file is not already opened by another program and try again."

If there are additional details that would scare the user such as an error number or something else only a developer would understand, don't show them. Write them to a log file, or have a details button that can be pressed to get to them.

I'm assuming you're talking about showing error messages to users in message boxes or on screen.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...