# dtolnay/thiserror

derive(Error) for struct and enum error types

Repository: https://github.com/dtolnay/thiserror
Canonical: https://ross.abutalabs.com/products/thiserror
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2026-08-22T02:41:20+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 96, longevity 100
- inputs: {"age_days": 2520, "days_push": 11, "days_rel": 25, "gap_med": 4.0, "n_releases_24m": 27}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5526, forks 214 (observed 2026-08-28T04:09:21.947456+00:00)

## What it is
A Rust library providing a convenient derive macro for implementing the standard library's std::error::Error trait on structs and enums. It generates Display impls and error conversions from attribute annotations without appearing in your public API.

## Use cases
- define custom error types in rust
- implement std::error::Error without boilerplate
- generate display messages for error enums
- convert underlying errors with #[from]
- make library error types ergonomic

## When to choose
- writing application or library code in rust that needs idiomatic error types
- you want handwritten-quality Error impls with minimal code
- you need error messages with interpolated fields

## When to avoid
- building applications where you want anyhow-style dynamic errors instead of typed enums
- working outside the rust ecosystem

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, serialization
- domain: developer-tools, programming-languages
- platform: rust
- tags: derive-macro, std-error-trait, ergonomics

## Member repositories
- dtolnay/thiserror (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:21.947456+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-29T17:55:46.056721+00:00, confidence not recorded.
  - readme: https://github.com/dtolnay/thiserror (fetched 2026-08-28T04:09:21.947456+00:00, sha 812a15055001)
  - registry_crates: https://crates.io/api/v1/crates/thiserror (fetched 2026-08-29T08:51:07.969879+00:00, sha 9d4c176a1cc6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
