Copilot commented on code in PR #3630:
URL: https://github.com/apache/thrift/pull/3630#discussion_r3564426123
##########
test/cpp/src/TestServer.cpp:
##########
@@ -768,6 +764,17 @@ int main(int argc, char** argv) {
std::shared_ptr<TServerSocket> serverSocket;
if (ssl) {
+ boost::filesystem::path testDir =
boost::filesystem::system_complete(argv[0]).parent_path();
+ while (!boost::filesystem::exists(testDir / "keys" / "server.crt")) {
+ boost::filesystem::path parent = testDir.parent_path();
+ if (parent == testDir) {
+ throw runtime_error("Unable to locate test/keys from " +
string(argv[0]));
+ }
Review Comment:
`throw runtime_error(...)` here is not caught by any surrounding
`try`/`catch` in `main`, so the process will call `std::terminate` and exit
with an abnormal status instead of following the existing pattern of printing
the error + usage and returning a normal non-zero code.
##########
test/cpp/src/TestClient.cpp:
##########
@@ -322,12 +318,24 @@ int main(int argc, char** argv) {
std::shared_ptr<TProtocol> protocol2; // SecondService for multiplexed
if (ssl) {
+ boost::filesystem::path testDir =
boost::filesystem::system_complete(argv[0]).parent_path();
+ while (!boost::filesystem::exists(testDir / "keys" / "CA.pem")) {
+ boost::filesystem::path parent = testDir.parent_path();
+ if (parent == testDir) {
+ throw runtime_error("Unable to locate test/keys from " +
string(argv[0]));
+ }
Review Comment:
`throw runtime_error(...)` here is not caught by any surrounding
`try`/`catch` in `main`, so the client will terminate abnormally (via
`std::terminate`) instead of returning the existing `ERR_UNKNOWN` code and
printing the usage message.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]