rust-impl-error-handling

Installation
SKILL.md

rust-impl-error-handling

Recoverable errors are values: Result<T, E> flows through the call graph, the ? operator early-returns on Err with an automatic From conversion, and a well-designed error type implements Display + std::error::Error (or core::error::Error in no_std). Panic is reserved for programmer bugs, not for expected failure modes.

Cross-references: [[rust-errors-thiserror-anyhow]] (library vs application error-crate choice), [[rust-errors-runtime]] (panic mechanics, unwind vs abort), [[rust-errors-build-link]] (compile-time error decoding), [[rust-syntax-pattern-matching]] (matching on Result and Option).


When to use this skill

  • User writes .unwrap() or .expect() in library code.
  • User asks "should this return Result or Option".
  • User asks "why does ? not compile" or gets E0277: the trait From<X> for Y is not implemented.
  • User designs a new error type and chooses between enum and struct.
  • User asks about core::error::Error vs std::error::Error.
  • User wants to chain errors with a source (cause) pointer.
  • User asks "should I panic here, or return Result".
  • User looks for Result combinators (map, map_err, and_then, or_else, ok_or).
Installs
2
First Seen
May 24, 2026
rust-impl-error-handling — impertio-studio/rust-claude-skill-package