From d831e0d57168cd21113fa4938ee7bb950ab36887 Mon Sep 17 00:00:00 2001 From: Zeke Foppa <196249+bfops@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:15:33 -0800 Subject: [PATCH] applyfix --- crates/cli/src/subcommands/server.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/cli/src/subcommands/server.rs b/crates/cli/src/subcommands/server.rs index cc28a76f85f..edd6b7c5cff 100644 --- a/crates/cli/src/subcommands/server.rs +++ b/crates/cli/src/subcommands/server.rs @@ -351,12 +351,17 @@ pub async fn exec_ping(config: Config, args: &ArgMatches) -> Result<(), anyhow:: let url = config.get_host_url(server)?; let builder = reqwest::Client::new().get(format!("{}/database/ping", url).as_str()); - match builder.send().await { - Ok(_) => { + let response = builder.send().await?; + + match response.status() { + reqwest::StatusCode::OK => { println!("Server is online: {}", url); } - Err(_) => { - println!("Server could not be reached: {}", url); + reqwest::StatusCode::NOT_FOUND => { + println!("Server returned 404 (Not Found): {}", url); + } + err => { + println!("Server could not be reached ({}): {}", err, url); } } Ok(())