oopsie 💥
Structured, context-rich error handling for Rust — define your error type once,
attach it to any Result with .context(...), and render colorized diagnostic
reports with automatic backtraces and span traces.

📦 Install
🚀 Quick start
use *;
#[oopsie] generates a context selector per variant — here app_oopsies::Connect,
in a module named after the type (AppError → app_oopsies) — alongside Display,
Debug, and Error impls. .context(selector) attaches your typed error to any
Result or Option. traced adds a captured backtrace (and a span trace with the
tracing feature) plus an automatic error code, and Report renders the result —
including panics, via its hook — as the colorized output shown above.
Unlike thiserror, the attachment points and the renderer come built in; unlike
anyhow / eyre, your errors stay strongly typed.
Crates
| Crate | What it is |
|---|---|
oopsie |
The facade — #[oopsie], Report, panic hook, prelude. Start here. |
oopsie-core |
Lower-level types (Backtrace, SpanTrace, Diagnostic, Welp), used through the facade. |
oopsie-macros |
The #[oopsie] attribute and Oopsie derive. |
Feature flags are documented in the crate docs.
Development
The MSRV is 1.89. A nightly toolchain is pinned in rust-toolchain.toml for the
snapshot tests and the unstable-feature lanes — you don't need it to use the crate.
Snapshot tests only match on the blessed feature combos; run just test-bless
after a change that legitimately shifts one.
Acknowledgements
oopsie builds on ideas from the Rust error-handling ecosystem:
- snafu — the context-selector pattern
behind
#[oopsie]: a selector per variant, attached to aResultwith.context(...). - color-eyre — the rich, colorized rendering of the error chain, span trace, and backtrace, and the matching panic hook.
License
Licensed under either of MIT or Apache-2.0 at your option.