From 804ab9d8ff003485f8992ac93d33a514146b07d2 Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Sun, 21 Jan 2024 19:47:57 -0600 Subject: [PATCH] docs: improve error message --- crates/ptth_relay/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ptth_relay/src/main.rs b/crates/ptth_relay/src/main.rs index 7dc7f4a..bf1b762 100644 --- a/crates/ptth_relay/src/main.rs +++ b/crates/ptth_relay/src/main.rs @@ -2,11 +2,11 @@ use std::{ convert::TryFrom, - error::Error, path::PathBuf, sync::Arc, }; +use anyhow::Context; use clap::{App, SubCommand}; use tracing_subscriber::{ fmt, @@ -21,7 +21,7 @@ use ptth_relay::{ }; #[tokio::main] -async fn main () -> Result <(), Box > { +async fn main () -> anyhow::Result<()> { fmt () .with_env_filter (EnvFilter::from_default_env ()) .with_span_events (FmtSpan::CLOSE) @@ -48,7 +48,7 @@ async fn main () -> Result <(), Box > { } let config_path = PathBuf::from ("config/ptth_relay.toml"); - let config = Config::from_file (&config_path).await?; + let config = Config::from_file (&config_path).await.context("couldn't load ptth_relay.toml")?; let (shutdown_rx, forced_shutdown) = ptth_core::graceful_shutdown::init_with_force ();