From c6f230a1681a5e4cb8f90eaf1820c036ea65106c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Mon, 31 Jan 2022 03:01:00 +1300 Subject: [PATCH] Pretty-print runtime errors --- cli/src/config/init.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/config/init.rs b/cli/src/config/init.rs index f8b290e..c433605 100644 --- a/cli/src/config/init.rs +++ b/cli/src/config/init.rs @@ -1,7 +1,7 @@ use std::convert::Infallible; use clap::ArgMatches; -use miette::Result; +use miette::{Report, Result}; use tracing::error; use watchexec::{config::InitConfig, error::RuntimeError, handler::SyncFnHandler}; @@ -22,10 +22,10 @@ pub fn init(_args: &ArgMatches<'static>) -> Result { if cfg!(debug_assertions) { eprintln!("[[{:?}]]", data); - } else { - eprintln!("[[{}]]", data); } + eprintln!("[[Error (not fatal)]]\n{}", Report::new(data)); + Ok(()) }, ));