()
| 4 | |
| 5 | #[tokio::main(flavor = "current_thread")] |
| 6 | async fn main() { |
| 7 | let res = cli::run().await; |
| 8 | if let Err(err) = res { |
| 9 | // Show the primary error |
| 10 | let mut chain = err.chain(); |
| 11 | if let Some(primary) = chain.next() { |
| 12 | if log_enabled!(log::Level::Error) { |
| 13 | log::error!("{}", style(primary).red()); |
| 14 | } else { |
| 15 | eprintln!("{} {}", style("Error:").bold().red(), style(primary).red()); |
| 16 | } |
| 17 | } |
| 18 | // Show causes in debug mode |
| 19 | if log_enabled!(log::Level::Debug) { |
| 20 | for cause in chain { |
| 21 | log::debug!("Caused by: {cause}"); |
| 22 | } |
| 23 | } |
| 24 | clean_logger(); |
| 25 | std::process::exit(1); |
| 26 | } |
| 27 | } |
nothing calls this directly
no test coverage detected