From 6ba1459a3c89ae19abc4534cfd7d4b65873ba7c5 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 11 Oct 2020 23:11:27 +0200 Subject: [PATCH] main: send error on invalid command --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7c14a5e..894e160 100644 --- a/src/main.rs +++ b/src/main.rs @@ -373,8 +373,10 @@ fn main() -> ! { SCB::sys_reset(); } } - Ok(SessionInput::Error(e)) => - error!("session input: {:?}", e), + Ok(SessionInput::Error(e)) => { + error!("session input: {:?}", e); + send_line(&mut socket, b"{ \"error\": \"invalid input\" }"); + } Err(_) => socket.close(), }