battery-pack-rs/battery-pack/error-handling-basics

Claude Code and agent skill by battery-pack-rs/battery-pack

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Essential Rust error handling rules for anyhow and thiserror users

Install

npx vskill@latest install battery-pack-rs/battery-pack/error-handling-basics

SKILL.md

Error Handling Basics

Display must not include the source

Error reporters walk .source() separately. Including it in Display causes double-printing:

rust
// Wrong
#[error("operation failed: {0}")]
MyError(#[source] io::Error)
// Right
#[error("operation failed")]
MyError(#[source] io::Error)

Context describes what was attempted, not what failed

rust
// Wrong: repeats what the source error already says
.context("file not found")
// Right: says what you were trying to do
.context("failed to load user config")

Production backtrace config

Set RUST_BACKTRACE=1 RUST_LIB_BACKTRACE=0. This gives panic backtraces without the performance cost of capturing one on every anyhow::Error.

More guidance

For comprehensive patterns (opaque library errors, internal error composition, structured logging, custom application error types), install the error battery pack:

sh
cargo install cargo-bp
cargo bp add error

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
78
Repository forks
12
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/battery-pack-rs/battery-pack/error-handling-basics/badge)](https://verified-skill.com/skills/battery-pack-rs/battery-pack/error-handling-basics)

Something wrong with this skill or its page? Tell us.