Commit 4d4c7f47 authored by Nick Mathewson's avatar Nick Mathewson 🦞
Browse files

Merge branch 'error-report' into 'main'

Improve error messages from arti cli

See merge request !331
parents d1f4e9f3 be2bb0cc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ dependencies = [
 "rlimit",
 "serde",
 "tokio",
 "tor-error",
 "tor-rtcompat",
 "tor-socksproto",
 "tracing",
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ clap = "2.33.0"
futures = "0.3.14"
float-ord = "0.3"
rand = "0.8"
anyhow = "1.0.5"
anyhow = "1.0.23"
serde = { version = "1.0.103", features = ["derive"] }
serde_json = "1.0.50"
tracing = "0.1.18"
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ tokio-crate = { package = "tokio", version = "1.4", features = ["rt", "rt-multi-
hyper = { version = "0.14", features = ["http1", "client", "runtime"] }
pin-project = "1"
tokio-util = { version = "0.6", features = ["compat"] }
anyhow = "1.0.5"
anyhow = "1.0.23"
tracing-subscriber = "0.3.0"
tempfile = "3.3"
once_cell = "1.9"
+2 −1
Original line number Diff line number Diff line
@@ -21,11 +21,12 @@ journald = [ "tracing-journald" ]

[dependencies]
arti-client = { package="arti-client", path = "../arti-client", version = "0.0.4", default-features=false}
tor-error = { path="../tor-error", version = "0.0.1", default-features=false }
tor-rtcompat = { path="../tor-rtcompat", version = "0.0.4", default-features=false }
tor-socksproto = { path="../tor-socksproto", version = "0.0.3"}
arti-config = { path="../arti-config", version = "0.0.4"}

anyhow = "1.0.5"
anyhow = "1.0.23"
async-ctrlc = { version = "1.2.0", optional = true }
config = { version = "0.11.0", default-features = false }
cfg-if = "1.0.0"
+7 −2
Original line number Diff line number Diff line
@@ -131,7 +131,12 @@ async fn run<R: Runtime>(
    )
}

fn main() -> Result<()> {
fn main() {
    main_main().unwrap_or_else(tor_error::report_and_exit);
}

/// Inner function to allow convenient error handling
fn main_main() -> Result<()> {
    // We describe a default here, rather than using `default()`, because the
    // correct behavior is different depending on whether the filename is given
    // explicitly or not.
@@ -218,7 +223,7 @@ fn main() -> Result<()> {

    let cfg = cfg_sources.load()?;

    let config: ArtiConfig = cfg.try_into()?;
    let config: ArtiConfig = cfg.try_into().context("read configuration")?;

    let _log_guards = trace::setup_logging(config.logging(), matches.value_of("loglevel"))?;

Loading