client: print errors and warnings to stderr
All checks were successful
Build and test / check (push) Successful in 1m55s
Build and test / build (push) Successful in 2m37s
Build and test / check-license (push) Successful in 1m3s
Build and test / test (push) Successful in 3m6s
Build and test / docs (push) Successful in 5m56s

This commit is contained in:
2025-12-16 17:20:04 +09:00
parent 043a1a7a7a
commit 10ef171c91
13 changed files with 24 additions and 19 deletions

View File

@@ -202,7 +202,7 @@ pub async fn print_authorization_owner_hint(
response => return erroneous_server_response(response),
};
println!(
eprintln!(
"Note: You are allowed to manage databases and users with the following prefixes:\n{}",
response.into_iter().map(|p| format!(" - {}", p)).join("\n")
);

View File

@@ -53,8 +53,11 @@ pub async fn drop_databases(
))
.interact()?;
//
if !confirmation {
// TODO: should we return with an error code here?
println!("Aborting drop operation.");
server_connection.send(Request::Exit).await?;
return Ok(());
}
}

View File

@@ -54,7 +54,9 @@ pub async fn drop_users(
.interact()?;
if !confirmation {
// TODO: should we return with an error code here?
println!("Aborting drop operation.");
server_connection.send(Request::Exit).await?;
return Ok(());
}
}

View File

@@ -292,7 +292,7 @@ async fn show_users(
Some(Ok(Response::ListAllUsers(result))) => match result {
Ok(users) => users,
Err(err) => {
println!("Failed to list users: {:?}", err);
eprintln!("Failed to list users: {:?}", err);
return Ok(());
}
},