Clarity and Consistency in Error Messages
Clear and consistent error messages are essential for helping users understand and resolve data validation issues. Unlike rule definitions, which are technical, error messages should be user-friendly and actionable.
Guiding Principlesโ
Be Clear and Conciseโ
Avoid technical jargon. Explain the error in simple terms that a business user can understand.
- โ Bad: "Rule violation: 'isTradeItemAConsumerUnit' is true but 'consumerFirstAvailabilityDateTime' is null."
- โ Good: "The 'Consumer First Availability Date' must be provided for a consumer unit."
Provide Actionable Guidanceโ
Tell the user exactly what they need to do to fix the problem.
- โ Bad: "Invalid data."
- โ Good: "The net weight is required for all food products."
Be Specificโ
Reference the specific fields or values that are incorrect.
- โ Bad: "A date is incorrect."
- โ Good: "The 'End Availability Date' cannot be before the 'Start Availability Date'."
Maintain a Consistent Toneโ
Use a helpful and professional tone. Avoid blaming the user.
- โ Bad: "You made an error."
- โ Good: "There is a conflict between the 'Packaging Type' and the 'Platform Type'."
Formatting Error Messagesโ
Highlight Key Termsโ
Use single quotes to highlight attribute names or specific values to draw attention to them.
Example:
โ The attribute 'Percentage Of Alcohol By Volume' must be filled in because of the chosen GPC Brick Code.
Hierarchy-Related Error Messagesโ
When dealing with rules that span multiple levels of a product hierarchy, make the context clear in the error message.
On Every Levelโ
โ 'Is Packaging Marked Returnable' must be filled in on every level of the packaging hierarchy.
Referencing Other Levelsโ
โ The item is not a base unit, so you must provide the 'Quantity Of Children', 'Total Quantity Of Next Lower Level Trade Item', 'Child Trade Item GTIN', and 'Quantity Of Next Lower Level Trade Item'.
By following these guidelines, you can create error messages that empower users to correct their data efficiently and accurately.