Rust error handling

From Jxck/sptth · View interactive version

Rust error handling is an AI agent skill from the GitHub repository Jxck/sptth. Use when changing Rust code paths that return errors or log failures. Ensures errors are actionable, consistent, and safe.

How to use this skill

Skill file

rust-error-handling Skill

Use this skill when changing Rust code paths that return errors or log failures.

Goal

Keep errors actionable, consistent, and easy to debug without leaking sensitive data.

Principles

Patterns

  1. Add context at I/O and boundary calls:
  1. Use bail! for validation failures with explicit reason.
  2. Keep logs structured and component-scoped (DNS, PROXY, TLS, etc.).
  3. Return typed status at boundaries (for HTTP/DNS behavior) and retain internal error cause.

Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.