Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pawurb committed Nov 22, 2024
1 parent 72d75c5 commit 71d9f94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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}"))
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 71d9f94

Please sign in to comment.