Skip to content

Commit

Permalink
Log additional endpoint info on Door open failure
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatcam committed Jan 3, 2024
1 parent 3a9a9ac commit f328be4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/ripple/server/impl/Door.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ Door<Handler>::reOpen()
{
std::stringstream ss;
ss << "Can't close acceptor: " << port_.name << ", "
<< port_.ip.to_string() << ":" << port_.port << " "
<< ec.message();
JLOG(j_.error()) << ss.str();
Throw<std::runtime_error>(ss.str());
Expand All @@ -247,7 +248,8 @@ Door<Handler>::reOpen()
acceptor_.open(local_address.protocol(), ec);
if (ec)
{
JLOG(j_.error()) << "Open port '" << port_.name
JLOG(j_.error()) << "Open port '" << port_.name << ", "
<< port_.ip.to_string() << ":" << port_.port << " "
<< "' failed:" << ec.message();
Throw<std::exception>();
}
Expand All @@ -256,23 +258,26 @@ Door<Handler>::reOpen()
boost::asio::ip::tcp::acceptor::reuse_address(true), ec);
if (ec)
{
JLOG(j_.error()) << "Option for port '" << port_.name
JLOG(j_.error()) << "Option for port '" << port_.name << ", "
<< port_.ip.to_string() << ":" << port_.port << " "
<< "' failed:" << ec.message();
Throw<std::exception>();
}

acceptor_.bind(local_address, ec);
if (ec)
{
JLOG(j_.error()) << "Bind port '" << port_.name
JLOG(j_.error()) << "Bind port '" << port_.name << ", "
<< port_.ip.to_string() << ":" << port_.port << " "
<< "' failed:" << ec.message();
Throw<std::exception>();
}

acceptor_.listen(boost::asio::socket_base::max_connections, ec);
if (ec)
{
JLOG(j_.error()) << "Listen on port '" << port_.name
JLOG(j_.error()) << "Listen on port '" << port_.name << ", "
<< port_.ip.to_string() << ":" << port_.port << " "
<< "' failed:" << ec.message();
Throw<std::exception>();
}
Expand Down

0 comments on commit f328be4

Please sign in to comment.