Print more descriptive error message when we fail to bind zeroconf to the given port.

This commit is contained in:
Michael Herger 2018-02-09 21:51:56 +01:00
parent 5ed4639cca
commit 4636cb71b9

View file

@ -215,7 +215,7 @@ pub fn discovery(handle: &Handle, config: ConnectConfig, device_id: String, port
let serve = {
let http = Http::new();
debug!("Zeroconf server listening on 0.0.0.0:{}", port);
http.serve_addr_handle(&format!("0.0.0.0:{}", port).parse().unwrap(), &handle, move || Ok(discovery.clone())).unwrap()
http.serve_addr_handle(&format!("0.0.0.0:{}", port).parse().unwrap(), &handle, move || Ok(discovery.clone())).expect("Unable to bind Zeroconf to port")
};
let s_port = serve.incoming_ref().local_addr().port();