Обработка ошибок в Rust через error-stack
engineering
handling-rust-errors is a Claude Code skill that defines HASH-specific error handling patterns in Rust using the error-stack crate for consistent, debuggable error management across the codebase. It covers three reference areas: defining custom error types with derive_more and Report<MyError>, propagating errors via change_context and change_context_with, and attaching context with attach or the lazy attach_with variant for expensive computations. The skill explicitly forbids anyhow, eyre, thiserror, and Box<dyn Error>, enforcing error-stack with ResultExt as the sole approach. One documented exception applies to the HashQL compiler (libs/@local/hashql/*), where hashql-diagnostics handles rich diagnostics with source spans, labeled regions, and fix suggestions. Rust developers building fallible APIs in HASH projects will find this skill essential for structuring Result types and error documentation uniformly.
- #rust
- #error-handling
- #error-stack
- #result-types
- #debugging