Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: register backtrace
Fintan Halpenny committed 8 months ago
commit 80dea75188f1c00a56466871cd4cf166bda9656b
parent acd76071644f9c810fd4ab961f1761c3820948e0
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:#}");