color-eyre icon indicating copy to clipboard operation
color-eyre copied to clipboard

add `suppress_backtrace` method

Open chris-laplante opened this issue 2 years ago • 0 comments

In my application, there are certain errors that are mundane enough that I don't really need a backtrace. But I still want to be able to propagate the error using all the nice eyre machinery I've set up. This PR adds a suppress_backtrace method which lets you do just that.

To expand a bit: in my application's main I set RUST_BACKTRACE to 1:

// Automatically enable backtracing unless user explicitly disabled it
if env::var("RUST_BACKTRACE").is_err() {
    env::set_var("RUST_BACKTRACE", "1");
}

This is so that when people report problems with my application, it will always spit out a useful backtrace that they can provide.

chris-laplante avatar Jul 15 '22 21:07 chris-laplante