client: print errors and warnings to stderr
All checks were successful
All checks were successful
This commit is contained in:
@@ -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")
|
||||
);
|
||||
|
||||
@@ -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(());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(());
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user