mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 20:09:59 +03:00
better error handling for port in use (#10)
This commit is contained in:
committed by
GitHub
parent
a1100cc8b2
commit
57b0d898c1
@@ -41,7 +41,13 @@ pub fn main() {
|
||||
};
|
||||
|
||||
// start receiving client connection requests
|
||||
let (request_server, request_thread) = request::Server::listen(port).unwrap();
|
||||
let (request_server, request_thread) = match request::Server::listen(port) {
|
||||
Err(e) => {
|
||||
eprintln!("Could not bind to port {port}: {e}");
|
||||
process::exit(1);
|
||||
}
|
||||
Ok(r) => r,
|
||||
};
|
||||
|
||||
println!("Press Ctrl+Alt+Shift+Super to release the mouse");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user