# thiserror

> derive(Error) for Rust's std::error::Error trait

Source: https://talira.ai/catalog/thiserror-rg8exjm1
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / error handling](https://talira.ai/categories/libraries/error-handling)
- Licence: MIT OR Apache-2.0[^1]
- Pricing: Free and open source
- Free tier: yes
- Backed by: [David Tolnay](https://talira.ai/orgs/dtolnay.md)

thiserror provides a derive macro for the standard library's std::error::Error trait in [Rust](https://talira.ai/catalog/rust-mf51vs5t.md). Put #[derive(Error)] on an enum or struct and #[error("...")] on each variant to generate its Display message, #[from] to generate a From conversion, and #[source] (or a field named source) to report the underlying error; error(transparent) forwards an inner error's message and source. The generated code is what you'd write by hand, so thiserror doesn't appear in your public API, and switching to or from handwritten impls isn't a breaking change. Its README suggests it for code that designs its own error types, most often libraries, and anyhow, by the same author, for application code that just wants errors to be easy.

## Links

- GitHub: https://github.com/https://github.com/dtolnay/thiserror
- Docs: https://docs.rs/thiserror

## Problems it solves

- define custom error types in my Rust library without boilerplate
- convert an io::Error into my own error enum automatically
- give each variant of my Rust error enum a readable message

## Features

- derive macro for std::error::Error
- Display messages from #[error] attributes
- From impls from #[from]
- source() from #[source] fields
- error(transparent) forwarding
- backtrace support

## Trust

Overall: 0.55 out of 1.
Signals: maintenance 0.71, adoption 0.75, momentum 0.55, community 0.54, backing 0.30, extensibility 0.00.

- last commit yesterday
- 16 commits in the last 90 days
- latest release 2.0.21 2 months ago
- 5.6k GitHub stars
- 22 contributors
- accepts sponsorship (Github)
- backed by David Tolnay

## Alternatives

- [anyhow](https://talira.ai/catalog/anyhow-y7bkkahz.md): A flexible concrete error type for easy error handling in Rust applications

## Sources

[^1]: https://github.com/dtolnay/thiserror/blob/master/Cargo.toml (checked 23 Nov 2026)
