Add logging 60/1160/1
authorSerban Jora <sj2381@att.com>
Thu, 1 Mar 2018 21:40:04 +0000 (16:40 -0500)
committerSerban Jora <sj2381@att.com>
Thu, 1 Mar 2018 21:40:10 +0000 (16:40 -0500)
Change-Id: I1308c36e314e099d39c9e0f638d4e5c6edfc3493
Signed-off-by: Serban Jora <sj2381@att.com>
Issue-Id: MODELING-276

gateway/src/main/java/org/acumos/federation/gateway/adapter/PeerGateway.java

index 99d8466..cad87e5 100644 (file)
@@ -152,16 +152,30 @@ public class PeerGateway {
                        for (MLPSolution peerSolution : this.solutions) {
                                // Check if the Model already exists in the Local Acumos
                                MLPSolution localSolution = null;
+                               log.info(EELFLoggerDelegate.debugLogger, "Processing peer solution {}", peerSolution);
                                try {
                                        localSolution = cdsClient.getSolution(peerSolution.getSolutionId());
                                } 
-                               catch (HttpStatusCodeException x) {
-                                       if (!Errors.isCDSNotFound(x)) {
+                               catch (HttpStatusCodeException scx) {
+                               try {
+                                       if (!Errors.isCDSNotFound(scx)) {
                                                log.error(EELFLoggerDelegate.errorLogger, "Failed to check if solution with id "
-                                                               + peerSolution.getSolutionId() + " exists locally, skipping for now. Response says " + x.getResponseBodyAsString(), x);
+                                                               + peerSolution.getSolutionId() + " exists locally, skipping for now. Response says " + scx.getResponseBodyAsString(), scx);
                                                continue;
                                        }
                                }
+                               catch (Exception tx) {
+                                       log.error(EELFLoggerDelegate.errorLogger, "Unexpected error while checking not found on "
+                                                               + peerSolution.getSolutionId(), tx);
+                                       continue;
+                               }
+
+                               }
+                               catch (Exception x) {
+                                       log.error(EELFLoggerDelegate.errorLogger, "Unexpected error while checking if solution with id "
+                                                               + peerSolution.getSolutionId() + " exists locally, skipping for now.", x);
+                                       continue;
+                               }
 
                                try {
                                        if (localSolution == null) {