From fd874a1830814cf797e0dda8b44e9df0c27f861f Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 1 May 2015 15:11:09 +0100 Subject: [PATCH] webdriver: Name http server thread for debugging. Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: b74083e44bb76cdafc1758849618b16161c2c20d --HG-- extra : subtree_source : http%3A//tristan.corp.lon2.mozilla.com%3A8000 extra : subtree_revision : 698c098280c8b63c06e1a2af1b2b9d40aec76b4b --- testing/webdriver/src/server.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testing/webdriver/src/server.rs b/testing/webdriver/src/server.rs index 6a8970fdae28..3b1133ff3304 100644 --- a/testing/webdriver/src/server.rs +++ b/testing/webdriver/src/server.rs @@ -196,7 +196,7 @@ impl Handler for HttpHandler { Ok(response) => (StatusCode::Ok, response.to_json_string()), Err(err) => (err.http_status(), err.to_json_string()), }, - Err(_) => panic!("Error reading response") + Err(e) => panic!("Error reading response: {:?}", e) } }, Err(err) => { @@ -226,9 +226,10 @@ pub fn start(address: SocketAddr, handler: T) { let http_handler = HttpHandler::new(api, msg_send); let server = Server::http(http_handler); - thread::spawn(move || { + let builder = thread::Builder::new().name("webdriver dispatcher".to_string()); + builder.spawn(move || { let mut dispatcher = Dispatcher::new(handler); dispatcher.run(msg_recv) - }); + }).unwrap(); server.listen(&address).unwrap(); }