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().
async
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.
- Docs: https://error.rust.phpboyscout.uk
- Tutorial: give your CLI a diagnostic error path
- How-to guides: install the pipeline, define an error type, set an exit code, add a footer
- Reference: every variant, code, default and failure mode
- What rtb-error does not do
- API reference: https://docs.rs/rtb-error
- Crate: https://crates.io/crates/rtb-error
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