error-handling
Language-idiomatic error handling: wrap errors with the failed operation's context, never swallow silently, `Result<T, E>` in Rust, `fmt.Errorf("doing X: %w", err)` in Go, typed exceptions in Python/Java, fail fast on unrecoverable errors. Load when writing or reviewing an error
Install
npx skills add https://github.com/Goldziher/ai-rulez/tree/main/internal/builtins/universal/code-quality/skills/error-handling
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install goldziher-ai-rulez@llmmart
git clone https://github.com/Goldziher/ai-rulez.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole goldziher/ai-rulez collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
- Always wrap errors with context describing what operation failed.
- Never swallow errors silently — either handle, propagate, or log them.
- Use language-idiomatic patterns:
Result<T, E>in Rust,if err != nilwithfmt.Errorf("doing X: %w", err)in Go, typed exceptions in Python/Java. - Fail fast on unrecoverable errors.
Files (ai-rulez)
-
SKILL.md 589 B
--- name: error-handling description: "Error handling by language: wrap with context, never swallow, Result in Rust, %w wrapping in Go, typed exceptions in Python and Java, fail fast. Use when writing or reviewing an error path or custom error type." --- - Always wrap errors with context describing what operation failed. - Never swallow errors silently — either handle, propagate, or log them. - Use language-idiomatic patterns: `Result<T, E>` in Rust, `if err != nil` with `fmt.Errorf("doing X: %w", err)` in Go, typed exceptions in Python/Java. - Fail fast on unrecoverable errors.
Reviews (0)
No reviews yet.
Comments
Sign in to join the conversation.
No comments yet. Start the conversation.