Pretty-print runtime errors
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<InitConfig> {
if cfg!(debug_assertions) {
eprintln!("[[{:?}]]", data);
- } else {
- eprintln!("[[{}]]", data);
}
+ eprintln!("[[Error (not fatal)]]\n{}", Report::new(data));
+
Ok(())
},
));
