aboutsummaryrefslogtreecommitdiff
path: root/karld/src/interface.rs
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-06-10 17:48:32 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-06-10 17:48:32 +0200
commit45f2d1651f17d7e155748cfd1e1cd9a96f3e530e (patch)
tree6847a4552db06b56a5e0a55aa56354eccb7c41b1 /karld/src/interface.rs
parentd65b915f3dfda28aad6f2806df38c8ad77135d8b (diff)
downloadkarlender-45f2d1651f17d7e155748cfd1e1cd9a96f3e530e.tar
karlender-45f2d1651f17d7e155748cfd1e1cd9a96f3e530e.tar.bz2
karlender-45f2d1651f17d7e155748cfd1e1cd9a96f3e530e.tar.zst
better cli
Diffstat (limited to 'karld/src/interface.rs')
-rw-r--r--karld/src/interface.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/karld/src/interface.rs b/karld/src/interface.rs
index 127c0db..750f307 100644
--- a/karld/src/interface.rs
+++ b/karld/src/interface.rs
@@ -1,5 +1,5 @@
use crate::handle_packet;
-use karlcommon::{socket_path, version, ClientboundPacket, ServerboundPacket};
+use karlcommon::{socket_path, version, ClientboundPacket, ProtoError, ServerboundPacket};
use log::{debug, error, info, warn};
use std::io;
use std::io::{BufRead, BufReader, ErrorKind, Write};
@@ -61,7 +61,10 @@ fn handle_connection(id: u32, mut stream: UnixStream) -> io::Result<()> {
Err(err) => {
warn!("client error: {:?}", &err);
responder
- .send(ClientboundPacket::Error(format!("{}", &err)))
+ .send(ClientboundPacket::Error(ProtoError::FormatError(format!(
+ "{}",
+ &err
+ ))))
.map_err(|_| io::Error::from(ErrorKind::InvalidInput))?
}
}