This commit is contained in:
2025-08-16 10:28:28 +02:00
parent 246304b9fa
commit 5eab3b080c
3 changed files with 54 additions and 33 deletions

View File

@@ -97,7 +97,15 @@ impl Server {
// Check if this is a QUIT command before processing
let is_quit = matches!(cmd, Cmd::Quit);
let res = cmd.run(self).await.unwrap_or(Protocol::err("unknown cmd from server"));
let res = match cmd.run(self).await {
Ok(p) => p,
Err(e) => {
if self.option.debug {
eprintln!("[run error] {:?}", e);
}
Protocol::err(&format!("ERR {}", e.0))
}
};
if self.option.debug {
println!("\x1b[34;1mqueued cmd {:?}\x1b[0m", self.queued_cmd);