5 releases

new 0.3.1 May 19, 2024
0.3.0 May 13, 2024
0.2.0 May 9, 2024
0.2.0-alpha Apr 26, 2024
0.1.0 Sep 17, 2019

#165 in Debugging

Download history 3/week @ 2024-02-15 12/week @ 2024-02-22 11/week @ 2024-02-29 11/week @ 2024-03-07 13/week @ 2024-03-14 7/week @ 2024-03-21 23/week @ 2024-03-28 17/week @ 2024-04-04 3/week @ 2024-04-11 6/week @ 2024-04-18 222/week @ 2024-04-25 52/week @ 2024-05-02 279/week @ 2024-05-09 139/week @ 2024-05-16

694 downloads per month
Used in spritec

MIT/Apache

51KB
1.5K SLoC

terminator

Rust library to provide fancy formatting for errors and backtraces. Based of and inspired by color-eyre. It is intended to be used in binary applications, not as error type in libraries.

Usage

To display pretty errors from your main function, you can just switch your error type to terminator::Terminator. However, to customise the appearance and behaviour of errors or to pretty print panics, set up your main function as below:

fn main() -> Result<(), terminator::Terminator> {
    terminator::Config::new()
        // modify config if you so wish
        // and install config (setting up panic hook)
        .install()?;

    Ok(())
}

Feature flags

Terminator can bundle support for common error trait object libraries like anyhow and eyre. Setting respective flags will enable conversions and ? operator for Terminator. By default, Terminator is backed by Box<dyn Error>.

Following flags are provided:

  • anyhow: use anyhow::Error as backend for Terminator (conflicts with eyre feature)
  • eyre: use eyre::Report as backend for Terminator (conflicts with anyhow feature)
  • compat: enable Compat struct as bridge between eyre and anyhow if both are used

Dependencies

~71KB