.. /index

eyre

eyre

eyre is a fork of anyhow for dynamic error handling in Rust, distinguished by its swappable report handler architecture. Where anyhow provides a fixed error report format, eyre lets you plug in custom handlers that control how errors are displayed, what context is captured, and how panics are presented.

Handler ecosystem

eyre's handler system enables companion crates with different tradeoffs:

This modularity is eyre's key advantage over anyhow: you can swap presentation without changing error-handling code throughout your application.

Public API warning

eyre's documentation explicitly warns against re-exporting eyre types in library public APIs. Because eyre introduces its own Report type (not just std::error::Error), re-exporting it creates version coupling and semver hazards. Libraries should use thiserror or snafu for typed error definitions; eyre belongs at the application boundary.

When to use eyre vs anyhow

Use eyre when you want customizable error presentation — colors, sections, SpanTraces, or other handler-specific features. Use anyhow when you just need straightforward error propagation with string context and fewer dependencies.

For the full decision matrix, see rust-error-crate-comparison and rust-error-handling.

Linked from

Sources