Skip to content

Commit

Permalink
[FOLD] Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
undertome committed Oct 15, 2020
1 parent 53e1772 commit 2265040
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/ripple/net/impl/HTTPStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ SSLStream::connect(

boost::system::error_code ec;

auto fail = [&errorOut, &ec](std::string const& errorIn) {
errorOut = errorIn + ": " + ec.message();
auto fail = [&errorOut, &ec](
std::string const& errorIn,
std::string const& message = "") {
errorOut = errorIn + ": " + (message.empty() ? ec.message() : message);
return false;
};

Expand All @@ -65,7 +67,7 @@ SSLStream::connect(
}
catch (std::exception const& e)
{
return fail("exception");
return fail("exception", e.what());
}

ec = ssl_ctx_.preConnectVerify(*stream_, host);
Expand Down Expand Up @@ -140,8 +142,10 @@ RawStream::connect(

boost::system::error_code ec;

auto fail = [&errorOut, &ec](std::string const& errorIn) {
errorOut = errorIn + ": " + ec.message();
auto fail = [&errorOut, &ec](
std::string const& errorIn,
std::string const& message = "") {
errorOut = errorIn + ": " + (message.empty() ? ec.message() : message);
return false;
};

Expand All @@ -156,7 +160,7 @@ RawStream::connect(
}
catch (std::exception const& e)
{
return fail("exception");
return fail("exception", e.what());
}

boost::asio::async_connect(
Expand Down

0 comments on commit 2265040

Please sign in to comment.