docs: improve error message
parent
649e52bfe1
commit
804ab9d8ff
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
convert::TryFrom,
|
convert::TryFrom,
|
||||||
error::Error,
|
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use anyhow::Context;
|
||||||
use clap::{App, SubCommand};
|
use clap::{App, SubCommand};
|
||||||
use tracing_subscriber::{
|
use tracing_subscriber::{
|
||||||
fmt,
|
fmt,
|
||||||
|
@ -21,7 +21,7 @@ use ptth_relay::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main () -> Result <(), Box <dyn Error>> {
|
async fn main () -> anyhow::Result<()> {
|
||||||
fmt ()
|
fmt ()
|
||||||
.with_env_filter (EnvFilter::from_default_env ())
|
.with_env_filter (EnvFilter::from_default_env ())
|
||||||
.with_span_events (FmtSpan::CLOSE)
|
.with_span_events (FmtSpan::CLOSE)
|
||||||
|
@ -48,7 +48,7 @@ async fn main () -> Result <(), Box <dyn Error>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let config_path = PathBuf::from ("config/ptth_relay.toml");
|
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 ();
|
let (shutdown_rx, forced_shutdown) = ptth_core::graceful_shutdown::init_with_force ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue