From 94d5eeca2f9b3892aea8e0e91c863a031e6bc157 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 26 Dec 2024 18:22:54 +0100 Subject: fix(pkgs/back): Use the errors display trait not debug Sadly, there seems to be no other way to change the error display, than wrapping main. --- pkgs/by-name/ba/back/src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ba/back/src/main.rs b/pkgs/by-name/ba/back/src/main.rs index 009bdb6..b75737a 100644 --- a/pkgs/by-name/ba/back/src/main.rs +++ b/pkgs/by-name/ba/back/src/main.rs @@ -9,6 +9,8 @@ // You should have received a copy of the License along with this program. // If not, see . +use std::process; + use clap::Parser; use config::BackConfig; use rocket::routes; @@ -21,8 +23,17 @@ mod error; pub mod git_bug; mod web; +fn main() -> Result<(), String> { + if let Err(err) = rocket_main() { + eprintln!("Error {err}"); + process::exit(1); + } else { + Ok(()) + } +} + #[rocket::main] -async fn main() -> Result<(), error::Error> { +async fn rocket_main() -> Result<(), error::Error> { let args = cli::Cli::parse(); let config = BackConfig::from_config_file(&args.config_file)?; -- cgit 1.4.1