Bubble up error
This commit is contained in:
parent
25e8f5ded9
commit
1627b55028
@ -4,16 +4,13 @@
|
||||
use ra_proc_macro::msg::{self, Message};
|
||||
use std::io;
|
||||
|
||||
pub fn run() {
|
||||
pub fn run() -> io::Result<()> {
|
||||
loop {
|
||||
let req = match read_request() {
|
||||
Err(err) => {
|
||||
// Panic here, as the stdin pipe may be closed.
|
||||
// Otherwise, client will be restarted the service anyway.
|
||||
panic!("Read message error on ra_proc_macro_srv: {}", err);
|
||||
}
|
||||
Ok(None) => continue,
|
||||
Ok(Some(req)) => req,
|
||||
// bubble up the error for read request,
|
||||
// as the stdin pipe may be closed.
|
||||
let req = match read_request()? {
|
||||
None => continue,
|
||||
Some(req) => req,
|
||||
};
|
||||
|
||||
let res = match req {
|
||||
|
@ -66,7 +66,7 @@ fn setup_logging() -> Result<()> {
|
||||
}
|
||||
|
||||
fn run_proc_macro_srv() -> Result<()> {
|
||||
ra_proc_macro_srv::cli::run();
|
||||
ra_proc_macro_srv::cli::run()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user