Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve metrics bind error message #40

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions foundations/src/telemetry/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use super::metrics;
use super::settings::TelemetrySettings;
use crate::{BootstrapResult, Result};
use anyhow::anyhow;
use anyhow::{anyhow, Context as _};
use futures_util::future::BoxFuture;
use futures_util::ready;
use futures_util::FutureExt;
Expand Down Expand Up @@ -114,7 +114,9 @@ pub(super) fn init(
#[cfg(feature = "settings")]
let addr = SocketAddr::from(addr);

let socket = TcpListener::from(bind_socket(addr)?);
let socket = TcpListener::from(
bind_socket(addr).with_context(|| format!("binding to socket {addr:?}"))?,
);
let builder = Server::from_tcp(socket)?;
let service = RouterService::new(router).map_err(|err| anyhow!(err))?;

Expand Down