1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-24 23:08:39 +01:00

Improve error message when monitoring fails

This commit is contained in:
Roman Zeyde 2018-06-23 16:18:41 +03:00
parent 11da7d884b
commit 144bc7ba6a
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

View file

@ -48,7 +48,10 @@ impl Metrics {
}
pub fn start(&self) {
let server = tiny_http::Server::http(self.addr).unwrap();
let server = tiny_http::Server::http(self.addr).expect(&format!(
"failed to start monitoring HTTP server at {}",
self.addr
));
let reg = self.reg.clone();
spawn_thread("metrics", move || loop {
if let Err(e) = handle_request(&reg, server.recv()) {