Skip to content

Use hyper::Server::try_bind to avoid panic!()

If you try to start a prometheus-hyper server when the bind port is already occupied the server will panic!() from inside hyper::Server::bind().

Because run() already returns Result<(), hyper::Error> we can switch to hyper::Server::try_bind() which returns an error that can be returned and gracefully handled.

Merge request reports

Loading