rtb-error 0.6.5

Error types and the diagnostic report pipeline. Part of the phpboyscout Rust toolkit.
Documentation

rtb-error

Part of the phpboyscout Rust toolkit: small, framework-free crates extracted from rust-tool-base.

Error types and the diagnostic report pipeline: the canonical Error enum, the Result<T, E = Error> alias, exit-code attachment (WithExitCode / exit_code_of), and the process-edge miette hook pipeline (report handler, panic hook, mutable footer). Errors are values: propagated with ?, rendered once at main().

#[tokio::main]
async fn main() -> miette::Result<()> {
    rtb_error::hook::install_report_handler();
    rtb_error::hook::install_panic_hook();
    // ...
    Ok(())
}

Install the hooks as the first statement in main. miette's renderer slot is filled by whichever comes first, your install call or the first Report constructed anywhere in the process, and losing that race is silent.

Development

just ci runs the full local gate (fmt, clippy, nextest, doc, deny). Tests include a cucumber BDD suite (tests/bdd.rs) and trybuild compile-fail fixtures (tests/trybuild.rs). Run them with cargo nextest run, because the global-hook tests need nextest's process-per-test isolation. Releases are cut by colophon from Conventional Commits, so do not tag manually.

License

MIT