Identify the error’s cause
Be specific: Vague error messages frustrate users.
Examples
❌ Something went wrong.
✅ Request could not be completed. It may be due to poor internet connection.
BY GOOGLE
❌ Bad directory.
✅ The specified 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.]
directory writable.]
BY GOOGLE
❌ Invalid field 'picture'.
✅ The 'picture' field can only appear once on the command line; this command
line contains the 'picture' field
line contains the 'picture' field
Identify the user’s invalid inputs
Examples
❌ Invalid order
✅ Order quantity(5) exceeds quantity available(3)
BY GOOGLE
❌ Invalid postal code.
✅ The postal code for the US must consist of either five or nine digits. The specified postal code (4872953) contained seven digits.
You can consider disclosing progressively or truncating non-essential parts if the inputs are too long.
Exercise
Which of the following error messages is best?
The specified bid ($5) is too low.
The specified bid is too low.
The specified bid is below the minimum bid ($8).
The specified bid ($5) is below the minimum bid ($8).
Specify requirements and constraints
Be specific about requirements and constraints, always assuming users ignorant of the limitations of your system.
Examples
❌ JSON data is too large
✅ The uploaded JSON size(50mb) exceeds the allowed limit(40mb). Consider splitting the data across multiple requests.
BY GOOGLE
❌ Permission denied.
✅ Permission denied.Only users in <group name> have access. [Details about adding users to the group.]
BY GOOGLE
❌ Time-out period exceeded.
✅ Time-out period (30s) exceeded. [Details about possible solution.]