Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Comment on lines +12 to +15
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we do this for the OP bin as well?


if let Err(err) = reth::cli::run() {
eprintln!("Error: {err:?}");
std::process::exit(1);
Expand Down
5 changes: 5 additions & 0 deletions bin/reth/src/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading