You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve message error if the port is taken (#3320)
# Description of Changes
As the title says
# Expected complexity level and risk
1
# Testing
- [x] Manually check the error launching a local pg instance
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
let extra = axum::Router::new().nest("/health", spacetimedb_client_api::routes::health::router());
187
187
let service = router(&ctx, db_routes, extra).with_state(ctx.clone());
188
188
189
-
let tcp = TcpListener::bind(listen_addr).await?;
189
+
let tcp = TcpListener::bind(listen_addr).await.context(format!(
190
+
"failed to bind the SpacetimeDB server to '{listen_addr}', please check that the address is valid and not already in use"
191
+
))?;
190
192
socket2::SockRef::from(&tcp).set_nodelay(true)?;
191
193
log::info!("Starting SpacetimeDB listening on {}", tcp.local_addr()?);
192
194
193
195
ifletSome(pg_port) = pg_port {
194
196
let server_addr = listen_addr.split(':').next().unwrap();
195
-
let tcp_pg = TcpListener::bind(format!("{server_addr}:{pg_port}")).await?;
197
+
let tcp_pg = TcpListener::bind(format!("{server_addr}:{pg_port}")).await.context(format!(
198
+
"failed to bind the SpacetimeDB PostgreSQL wire protocol server to {server_addr}:{pg_port}, please check that the port is valid and not already in use"
199
+
))?;
196
200
197
201
let notify = Arc::new(tokio::sync::Notify::new());
0 commit comments