asio::spawn(io, [this, sslConn](asio::yield_context yc) { NewClientHandler(yc, sslConn, String(), RoleServer); });
} catch (const std::exception& ex) {
- Log(LogCritical, "ApiListener") << "Cannot accept new connection: " << DiagnosticInformation(ex, false);
+ Log(LogCritical, "ApiListener")
+ << "Cannot accept new connection: " << DiagnosticInformation(ex, false);
}
}
}
} catch (const std::exception& ex) {
endpoint->SetConnecting(false);
- std::ostringstream info;
- info << "Cannot connect to host '" << host << "' on port '" << port << "'";
- Log(LogCritical, "ApiListener", info.str());
- Log(LogDebug, "ApiListener")
- << info.str() << "\n" << DiagnosticInformation(ex);
+ Log(LogCritical, "ApiListener")
+ << "Cannot connect to host '" << host << "' on port '" << port << "': " << ex.what();
}
});
}