Install any skill in seconds. Free to start, no credit card required.
Get Started Free →hashintel/handling-rust-errors
HASH error handling patterns using error-stack crate.
Passed 21 of 22 test cases with the skill, and 10 of 22 without it.
and 16 more in the full report
12 fixed9 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 12 test cases the skill fixed. Same model, same prompt, with and without the skill.
Create a Rust error enum `DatabaseError` in `crates/db/src/errors.rs` with variants `ConnectionFailed` and `QueryTimeout`. Write the standard definition using our repository's standard derive annotations.
| Checked | Without skill | With skill |
|---|---|---|
| Uses derive_more annotations on the error enum | Missed | Passed |
| Avoids using thiserror | Missed | Passed |
The instructions your model reads when the skill loads.
HASH-specific error handling patterns using the error-stack crate for consistent, debuggable error handling across the Rust codebase.
HASH uses error-stack exclusively for error handling:
✅ DO:
Report<MyError> for all error typesReport<MyError>Error from core::error:: (not std::error::)ResultExt as _ for trait methods❌ DON'T:
anyhow or eyre cratesBox<dyn Error> (except in tests/prototyping)Report<Box<dyn Error>>thiserror (use derive_more instead)HashQL compiler code uses a different error handling approach.
Code in libs/@local/hashql/* uses the hashql-diagnostics crate instead of error-stack. This is because compiler errors require rich formatting capabilities:
Which approach to use:
| Location | Error Handling |
|---|---|
libs/@local/hashql/* (compiler code) | Use hashql-diagnostics → See writing-hashql-diagnostics skill |
| Everywhere else | Use error-stack patterns from this skill |
test cases passed, vs 10 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.