sonar critical for error-handling 79/30279/1
authorDushyant Singh Thakur <dt00503496@techmahindra.com>
Mon, 5 Feb 2018 14:01:10 +0000 (19:31 +0530)
committerDushyant Singh Thakur <dt00503496@techmahindra.com>
Mon, 5 Feb 2018 14:01:10 +0000 (19:31 +0530)
Used a logger to log the exception
Sonar Link:
https://sonar.onap.org/component_issues?id=org.onap.dmaap.messagerouter.mirroragent%3AdmaapMMAgent#assignees=dthakur
Location:
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
Line No-175

Change-Id: I69afcf9e8f4f40c9054d52e56f9704d3b102412d
Issue-ID: DMAAP-226
Signed-off-by: Dushyant Singh Thakur <dt00503496@techmahindra.com>
src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java

index bd2a2a5..2fc712b 100644 (file)
@@ -173,7 +173,7 @@ public class MirrorMakerAgent {
                                try {
                                        input.close();
                                } catch (IOException e) {
-                                       e.printStackTrace();
+                                       logger.error("Exception occurred is " +e);
                                }
                        }
                        if (out != null) {
@@ -361,7 +361,7 @@ public class MirrorMakerAgent {
 
                        }
                } catch (Exception e) {
-                       e.printStackTrace();
+                       logger.error("Exception is : " +e);
                }
 
        }