Send quit-package to server on stdout-error
Opened this issue · 2 comments
SvantjeJung commented
Change error handling from info! to sending quit-package to server because if there is an error on stdout client will not be able to interact with server anymore. So client program must be closed.
let e = stdout().flush();
match e {
Ok(_) => {},
Err(_) => info!("")
}
SvantjeJung commented
Found the following in this rust issue:
print!("Type something: ");
io::stdout().flush().ok().expect("Could not flush stdout");
I think that would be a nicer way to handle flush()-errors.
LukasKalbertodt commented
Well... expect
is just unwrap()
with custom error message ;)
But sure, flush
failing is too unlikely...