feat(cli): enable backtrace on panic by default (#5942)

This commit is contained in:
Alexey Shekhirin
2024-01-04 17:59:19 +00:00
committed by GitHub
parent 09f04a0f6c
commit 0520c62bb6
2 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,11 @@ compile_error!("Cannot build the `reth` binary with the `optimism` feature flag
#[cfg(not(feature = "optimism"))]
fn main() {
// Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided.
if std::env::var("RUST_BACKTRACE").is_err() {
std::env::set_var("RUST_BACKTRACE", "1");
}
if let Err(err) = reth::cli::run() {
eprintln!("Error: {err:?}");
std::process::exit(1);

View File

@ -9,6 +9,11 @@ compile_error!("Cannot build the `op-reth` binary with the `optimism` feature fl
#[cfg(feature = "optimism")]
fn main() {
// Enable backtraces unless a RUST_BACKTRACE value has already been explicitly provided.
if std::env::var("RUST_BACKTRACE").is_err() {
std::env::set_var("RUST_BACKTRACE", "1");
}
if let Err(err) = reth::cli::run() {
eprintln!("Error: {err:?}");
std::process::exit(1);