Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: register backtrace
Fintan Halpenny committed 9 months ago
commit 174792813aaa0d51de721c6dfe6d299ff7e03ab6
parent 0aaa81f82a60d35310c09b518ffb283bf1bb1af4
1 file changed +8 -0
modified crates/radicle-node/src/main.rs
@@ -131,6 +131,14 @@ fn execute() -> anyhow::Result<()> {
}

fn main() {
+
    // If `RUST_BACKTRACE` does not have a value, then we set it to capture
+
    // backtraces for better debugging, otherwise we keep the environments
+
    // value.
+
    const RUST_BACKTRACE: &str = "RUST_BACKTRACE";
+
    if std::env::var_os(RUST_BACKTRACE).is_none() {
+
        std::env::set_var(RUST_BACKTRACE, "1");
+
    }
+

    if let Err(err) = execute() {
        if log::log_enabled!(target: "node", log::Level::Error) {
            log::error!(target: "node", "Fatal: {err:#}");