diff --git a/meilisearch/src/main.rs b/meilisearch/src/main.rs index e881734fb..2e70b4eb7 100644 --- a/meilisearch/src/main.rs +++ b/meilisearch/src/main.rs @@ -72,6 +72,19 @@ fn on_panic(info: &std::panic::PanicInfo) { #[actix_web::main] async fn main() -> anyhow::Result<()> { + try_main().await.inspect_err(|error| { + tracing::error!(%error); + let mut current = error.source(); + let mut depth = 0; + while let Some(source) = current { + tracing::info!(%source, depth, "Error caused by"); + current = source.source(); + depth += 1; + } + }) +} + +async fn try_main() -> anyhow::Result<()> { let (opt, config_read_from) = Opt::try_build()?; std::panic::set_hook(Box::new(on_panic));