Skip to content

Commit

Permalink
fix inconsistent behavior (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc authored May 7, 2020
1 parent 9a38e54 commit 1666a4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ color-backtrace = "0.4.0"
backtrace = "0.3"
indenter = "0.2.0"
ansi_term = "0.12.1"
color-spantrace = { version = "0.1", optional = true }
color-spantrace = { version = "0.1.1", optional = true }


[dev-dependencies]
tracing-subscriber = "0.2.5"
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ pub struct Context {
impl EyreContext for Context {
#[allow(unused_variables)]
fn default(error: &(dyn std::error::Error + 'static)) -> Self {
let backtrace = if std::env::var("RUST_LIB_BACKTRACE").is_ok() {
let backtrace = if std::env::var("RUST_LIB_BACKTRACE")
.or_else(|_| std::env::var("RUST_BACKTRACE"))
.is_ok()
{
Some(Backtrace::new())
} else {
None
Expand Down

0 comments on commit 1666a4d

Please sign in to comment.