# shepmaster/snafu

Easily assign underlying errors into domain-specific errors while adding context

Repository: https://github.com/shepmaster/snafu
Canonical: https://ross.abutalabs.com/products/snafu
Homepage: https://docs.rs/snafu/
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust, error-handling
Last push: 2026-07-21T17:53:23+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 35, longevity 100
- inputs: {"age_days": 2775, "days_push": 43, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1895, forks 71 (observed 2026-08-28T04:05:50.941759+00:00)

## What it is
SNAFU is a Rust library for ergonomically creating domain-specific error types and attaching context to underlying errors. It uses a derive macro to generate error enums with display messages, source chaining, backtraces, and optional no_std and futures support.

## Use cases
- define typed error enums for a rust library
- add context to underlying errors in rust
- convert io errors into domain-specific errors
- get backtraces with rust errors
- handle errors in async rust code
- quick ad-hoc error messages with whatever macro
- error handling in no_std embedded rust

## When to avoid
- you just need quick stringly-typed errors without custom types
- you prefer another error library like thiserror or anyhow already in your stack

## Facets
- artifact type: library
- maturity: stable
- function: error-handling
- domain: developer-tools, programming-languages
- platform: rust, cross-platform
- tags: error-derive-macro, no-std, backtrace, context-annotation, futures-support

## Member repositories
- shepmaster/snafu (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:50.941759+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:12:52.073396+00:00, confidence not recorded.
  - readme: https://github.com/shepmaster/snafu (fetched 2026-08-28T04:05:50.941759+00:00, sha cc2ca53162bc)
  - homepage: https://docs.rs/snafu/ (fetched 2026-08-29T10:51:53.698490+00:00, sha 18bbeae42561)
  - site_page: https://docs.rs/ (fetched 2026-08-29T10:51:53.708220+00:00, sha 3bbd16cab5f6)
  - site_page: https://docs.rs/crate/snafu/latest (fetched 2026-08-29T10:51:53.710226+00:00, sha f5a26a503a38)
  - site_page: https://docs.rs/crate/snafu/latest/features (fetched 2026-08-29T10:51:53.712007+00:00, sha 765f1c69ea75)
  - site_page: https://docs.rs/about (fetched 2026-08-29T10:51:53.713747+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T10:51:53.715271+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T10:51:53.716916+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T10:51:53.719069+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T10:51:53.720873+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
