error-messages

Solid

Error Message Style Guide for Validation Errors

AI & Automation 4,550 stars 412 forks Updated today MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Error Message Style Guide This guide establishes the standard format for validation error messages in the gh-aw codebase. All validation errors should be clear, actionable, and include examples. ## Error Message Template ``` [what's wrong]. [what's expected]. [example of correct usage] ``` Each error message should answer three questions: 1. **What's wrong?** - Clearly state the validation error 2. **What's expected?** - Explain the valid format or values 3. **How to fix it?** - Provide a concrete example of correct usage ## Good Examples These examples follow the template and provide actionable guidance: ### Time Delta Validation (from time_delta.go) ```go return nil, fmt.Errorf("invalid time delta format: +%s. Expected format like +25h, +3d, +1w, +1mo, +1d12h30m", deltaStr) ``` ✅ **Why it's good:** - Clearly identifies the invalid input - Lists multiple valid format examples - Shows combined formats (+1d12h30m) ### Type Validation with Example ```go return "", fmt.Errorf("manual-approval value must be a string, got %T. Example: manual-approval: \"production\"", val) ``` ✅ **Why it's good:** - Shows actual type received (%T) - Provides concrete YAML example - Uses proper YAML syntax with quotes ### Enum Validation with Options ```go return fmt.Errorf("invalid engine: %s. Valid engines are: copilot, claude, codex, custom. Example: engine: copilot", engineID) ``` ✅ **Why it's good:** - Lists all valid options - Provides simplest example - Uses consistent formatting ...

Details

Author
github
Repository
github/gh-aw
Created
9 months ago
Last Updated
today
Language
Go
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category