fix: add fatal log for bind failure with host and port details

This commit is contained in:
Quinten 2025-10-07 16:41:10 +02:00
parent f598fbc185
commit 8fa1c44f78

View File

@ -70,6 +70,8 @@ void Socket::bind(const std::string &host, const int port) const
if (::bind(fd_, (struct sockaddr *)&address, sizeof(address)) < 0) // NOLINT(cppcoreguidelines-pro-type-cstyle-cast if (::bind(fd_, (struct sockaddr *)&address, sizeof(address)) < 0) // NOLINT(cppcoreguidelines-pro-type-cstyle-cast
{ {
Log::fatal("Cannot bind to " + host + ":" + std::to_string(port) +
" - address already in use or permission denied");
throw std::runtime_error("Bind failed"); throw std::runtime_error("Bind failed");
} }
} }