Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when adding, changing, debugging, or reviewing Rust service error handling and observability, especially when separating domain errors from HTTP responses, adding thiserror/anyhow, implementing ResponseError or IntoResponse, adding tracing spans, redacting secrets, or diagnosing async failures.
.claude/skills/hashgraph-online-rust-error-observability/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 22% | 0% |
| case-01 | ✓→✓ | = Same ✓ | -9% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -3% | 0% |
Use this skill to make Rust service failures understandable to operators while keeping user-facing responses safe. Treat error handling and telemetry as one design surface.
worker errors, middleware, logs, and tracing setup.
thiserror for expected branches that callersshould match on.
anyhow or opaque applicationerrors when callers should not match every dependency failure.
ResponseError,Axum IntoResponse, or a small adapter function.
not raw payloads or secrets.
request context is available.
error.
failures become a consistent 500.
unwrap, expect, or stringly map_err in service paths unless theinvariant is local and the panic message is useful.
Read references/error-boundaries.md when choosing between thiserror, anyhow, opaque errors, and framework response adapters.
operations, and worker jobs at boundaries.
#[tracing::instrument(skip(...))] for request bodies, pools, clients,passwords, tokens, and large values.
idempotency key when safe.
Read references/tracing.md for spans, subscriber setup, and test logging. Read references/secrets-and-pii.md before touching secret-bearing values.
Keep response errors stable and intentional:
rustpub enum SubscribeError { Validation(SubscribeValidationError), Unexpected(anyhow::Error), } impl actix_web::ResponseError for SubscribeError { fn status_code(&self) -> actix_web::http::StatusCode { match self { Self::Validation(_) => actix_web::http::StatusCode::BAD_REQUEST, Self::Unexpected(_) => actix_web::http::StatusCode::INTERNAL_SERVER_ERROR, } } }
The response body should be safe for users. The trace event should carry the diagnostic context operators need.
references/error-boundaries.md: choosing error types and response adapters.references/tracing.md: spans, fields, subscriber setup, and test output.references/secrets-and-pii.md: redaction rules for secrets and sensitiveuser data.
Other measured skills in the registry, with their headline benchmark lift.