From f989a40a039b6e3fb699a82ed4cdaac8bdf8e600 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Tue, 27 Aug 2024 12:18:30 -0400 Subject: [PATCH] HPCC4J-631 Provide meaningful version error message (#741) Signed-off-by: Rodrigo Pastrana --- .../ws/client/BaseHPCCWsClient.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java b/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java index 0dfe94b5e..2ee1461a9 100644 --- a/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java +++ b/wsclient/src/main/java/org/hpccsystems/ws/client/BaseHPCCWsClient.java @@ -1,6 +1,7 @@ package org.hpccsystems.ws.client; import java.io.ByteArrayInputStream; +import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -159,24 +160,44 @@ private String getTargetHPCCBuildVersionString() throws Exception if (wsconn == null) throw new Exception("Cannot get target HPCC build version, client connection has not been initialized."); - String response = wsconn.sendGetRequest("WsSMC/Activity?rawxml_");//throws + String response = wsconn.sendGetRequest("WsSMC/Activity?rawxml_");//throws IOException if http != ok if (response == null || response.isEmpty()) throw new Exception("Cannot get target HPCC build version, received empty " + wsconn.getBaseUrl() + " wssmc/activity response"); + String header = response.substring(0, 100).trim(); //crude, but can prevent wasteful overhead + if (header.startsWith("