Fixed sonar issues in SpringServiceImpl.java 85/74585/1
authorezhil <ezhrajam@in.ibm.com>
Wed, 12 Dec 2018 16:51:25 +0000 (22:21 +0530)
committerezhil <ezhrajam@in.ibm.com>
Wed, 12 Dec 2018 16:51:41 +0000 (22:21 +0530)
Logged exceptions
Issue-ID: CCSDK-818
Change-Id: I90fc2d9c8d7e2627fc2c1f80628a9f4a0e7531da
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceImpl.java

index c5cabe5..347a239 100644 (file)
@@ -135,7 +135,7 @@ public class SpringServiceImpl implements SpringService {
             if (e instanceof NengException) {
                 throw e;
             } else {
-                e.printStackTrace();
+                log.warning(e.getMessage());
                 throw new Exception("Internal error occurred while processing the request");
             }
         }
@@ -149,6 +149,7 @@ public class SpringServiceImpl implements SpringService {
         try {
             return policyDetailsRepository.findPolicyResponseByName(policyName);
         } catch (Exception e) {
+            log.warning(e.getMessage());
             return new PolicyDetails();
         }
     }
@@ -190,7 +191,7 @@ public class SpringServiceImpl implements SpringService {
             if (e instanceof NengException) {
                 throw e;
             } else {
-                e.printStackTrace();
+                log.warning(e.getMessage());
                 throw new Exception("Internal error occurred while processing the request");
             }
         }