Panic proc macro srv if read request failed

This commit is contained in:
Edwin Cheng 2020-04-24 00:06:01 +08:00
parent 278bf351e3
commit 0744497699

View File

@ -8,8 +8,9 @@ pub fn run() {
loop {
let req = match read_request() {
Err(err) => {
eprintln!("Read message error on ra_proc_macro_srv: {}", err);
continue;
// Panic here, as the stdin pipe may be closed.
// Otherwise, client will be restart the service anyway.
panic!("Read message error on ra_proc_macro_srv: {}", err);
}
Ok(None) => continue,
Ok(Some(req)) => req,