TatoniMatteo commented on code in PR #1589:
URL: https://github.com/apache/syncope/pull/1589#discussion_r4387071805


##########
client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java:
##########
@@ -227,15 +216,8 @@ protected class ConnectorChecker extends Checker {
         }
 
         @Override
-        public String call() {
-            try {
-                return "{ \"status\": \"%s\", \"target\": \"%s\"}".formatted(
-                        connectorRestClient.check(coreAddress, domain, jwt, 
key)
-                        ? TopologyNode.Status.REACHABLE : 
TopologyNode.Status.UNREACHABLE, key);
-            } catch (Exception e) {
-                LOG.warn("Error checking connection for {}", key, e);
-                return "{ \"status\": \"%s\", \"target\": 
\"%s\"}".formatted(TopologyNode.Status.FAILURE, key);
-            }
+        public Boolean call() throws IOException {
+            return connectorRestClient.check(coreAddress, domain, jwt, key);

Review Comment:
   The `try / catch` logic was duplicated for both connectors and resources. I 
extracted and consolidated it into `checkWithTimeout`.



-- 
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]

Reply via email to