Identify the error's cause
Tell users exactly what went wrong. Be specific—vague error messages
frustrate users.
Not recommended
Bad directory.
Recommended
The [Name of directory] directory exists but is not writable. To add
files to this directory, the directory must be writable. [Explanation of
how to make this directory writable.]
Not recommended
Invalid field 'picture'.
Recommended
The 'picture' field can only appear once on the command line; this command
line contains the 'picture' field <N> times.
Note: Prior to version 2.1, you could specify the 'picture' field more than
once, but more recent versions no longer support this.
Next unit: Identify the user's invalid inputs
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-16 UTC.
[null,null,["Last updated 2024-10-16 UTC."],[[["Error messages should clearly state the specific problem encountered by the user, avoiding vague or generic descriptions."],["Provide detailed explanations of the error, including context like incorrect field usage or directory permissions, along with potential solutions or workarounds."],["Consider the user's perspective and avoid technical jargon, focusing on clarity and actionable information to help resolve the issue."],["When applicable, mention relevant version changes or limitations that might be contributing to the error, guiding users towards a better understanding of the problem."],["Instead of simply stating the error, offer constructive guidance on how to correct the issue, empowering users to troubleshoot and resolve errors independently."]]],["Error messages should be specific, not vague. Instead of \"Bad directory,\" indicate the directory name and the specific issue, like lack of write permissions, providing instructions on resolution. For invalid fields, specify the field and the problem, for example, the 'picture' field appearing multiple times when only one instance is allowed. Explain changes in versions if applicable. The goal is to clearly inform the user about the error and how to fix it.\n"]]