From 71d9f94b4a215439332bcf80cbf2e7cb5799572b Mon Sep 17 00:00:00 2001 From: pawurb Date: Sat, 23 Nov 2024 00:05:18 +0100 Subject: [PATCH] Minor fixes --- bin/main.rs | 7 +++++-- src/lib.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/main.rs b/bin/main.rs index 5f266a8..fb1012a 100644 --- a/bin/main.rs +++ b/bin/main.rs @@ -35,7 +35,7 @@ pub enum PgSubcommand { #[command(about = "Diagnose common database problems")] Diagnose(EmptyArgs), #[cfg(feature = "web")] - #[command(about = "Start UI web server")] + #[command(about = "Start dashboard web server")] Web(EmptyArgs), #[command(about = &AllLocks::description())] AllLocks(EmptyArgs), @@ -244,7 +244,10 @@ async fn start_web_server(pool: PgPool) -> Result<(), PgExtrasError> { .await .is_err() { - PgExtrasError::Other(format!("Port {} is already in use", port)); + return Err(PgExtrasError::Other(format!( + "Port {} is already in use", + port + ))); } let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}")) diff --git a/src/lib.rs b/src/lib.rs index 9526f50..09bab09 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -274,7 +274,7 @@ impl fmt::Display for PgExtrasError { "Both $DATABASE_URL and $PG_EXTRAS_DATABASE_URL are not set." } Self::DbConnectionError(e) => &format!("Cannot connect to database: '{}'", e), - Self::Other(e) => &format!("Other pg-extras error: '{}'", e), + Self::Other(e) => &format!("{}", e), }; write!(f, "{}", msg)