Skip to content

Commit d7d22b6

Browse files
authored
Show backtrace on errors when RUST_BACKTRACE=1 environment variable is set (#841)
Show backtrace on errors when the RUST_BACKTRACE=1 environment variable is set. Also enable showing the back trace during the python integration tests to help debug in some intermittent errors on OSX CI.
1 parent 4580345 commit d7d22b6

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

src/main.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,12 +509,7 @@ fn main() {
509509
}
510510
}
511511

512-
eprintln!("Error: {err}");
513-
for (i, suberror) in err.chain().enumerate() {
514-
if i > 0 {
515-
eprintln!("Reason: {suberror}");
516-
}
517-
}
512+
eprintln!("Error: {:?}", err);
518513
std::process::exit(1);
519514
}
520515
}

tests/integration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _sample_process(self, script_name, options=None, include_profile_name=False)
4545
]
4646
cmdline.extend(options or [])
4747
cmdline.extend(["--", sys.executable, script_name])
48-
env = dict(os.environ, RUST_LOG="info")
48+
env = dict(os.environ, RUST_LOG="info", RUST_BACKTRACE="1")
4949
subprocess.check_output(cmdline, env=env)
5050
with open(filename) as f:
5151
profiles = json.load(f)

0 commit comments

Comments
 (0)