Crates.io | terminator |
lib.rs | terminator |
version | 0.3.2 |
source | src |
created_at | 2019-09-17 00:12:32.831838 |
updated_at | 2024-11-17 10:57:48.147415 |
description | Formatter for pretty panics and errors |
homepage | |
repository | https://github.com/rkuklik/terminator |
max_upload_size | |
id | 165326 |
size | 62,957 |
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.
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(())
}
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::Error
as backend for Terminator
(conflicts with eyre feature)eyre::Report
as backend for Terminator
(conflicts with anyhow feature)Compat
struct as bridge between eyre
and anyhow
if both are used