Rust Error Handling
Implements idiomatic Rust error handling patterns using Result, Option, and industry-standard crates like thiserror and anyhow.
This skill equips Claude with the deep expertise required to implement robust, production-grade error handling in Rust applications. It provides standardized patterns for working with the Result and Option types, propagating errors via the '?' operator, and choosing between library-focused error definition with thiserror or application-level context with anyhow. By guiding the AI to avoid unsafe patterns like unwrap() and expect(), this skill ensures that generated Rust code is reliable, maintainable, and follows the principle of 'errors as values' inherent to the language.
주요 기능
0195 GitHub stars
02Idiomatic Result and Option pattern implementation
03Context-rich application error management with anyhow
04Custom error type definition with thiserror for libraries
05Functional error handling using map, and_then, and ok_or combinators
06Streamlined error propagation using the '?' operator
사용 사례
01Adding descriptive context to application-level errors to improve observability and debugging
02Designing hierarchical custom error types for new Rust libraries and crates
03Refactoring legacy Rust code to replace panics and unwraps with safe error propagation