Return Result from server main

This commit is contained in:
2026-06-23 21:26:14 -04:00
parent 1b8d382906
commit f34aeafe0e
2 changed files with 11 additions and 3 deletions

View File

@@ -23,7 +23,12 @@ fn main() {
} }
#[cfg(feature = "server")] #[cfg(feature = "server")]
fn main() { fn main() -> std::process::ExitCode {
tracing_setup(); tracing_setup();
server::main()
if let Err(e) = server::main() {
tracing::error!("Server main failed:\n{e}");
}
std::process::ExitCode::FAILURE
} }

View File

@@ -1,9 +1,12 @@
use crate::App; use crate::App;
use crate::util::error::Error;
pub fn main() { pub fn main() -> Result<()> {
if let Err(e) = dotenvy::dotenv() { if let Err(e) = dotenvy::dotenv() {
tracing::warn!("Error reading .env: {e}"); tracing::warn!("Error reading .env: {e}");
} }
dioxus::launch(App); dioxus::launch(App);
Err(Error::message_here("Web server exited"))
} }