aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrama-huawei <rama.subba.reddy.s@huawei.com>2017-09-15 18:03:48 +0530
committerRama SubbaReddy <rama.subba.reddy.s@huawei.com>2017-09-15 13:27:48 +0000
commit6897272aefdaa9d070c162991cbb6154c2be79b3 (patch)
tree6a3995ed4edb69c715b74b85c7baef8a86b65bba
parent547a353b8329b253f032b9889ea1cf97a6d3469d (diff)
Fix for sonar critical issues
DCAEGEN2-93 Change-Id: I06993bfcc5b4013326f7c8c72bd4f3c38c84f0fd Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
-rw-r--r--src/main/java/com/att/nsa/mr/tools/TopicCommand.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/com/att/nsa/mr/tools/TopicCommand.java b/src/main/java/com/att/nsa/mr/tools/TopicCommand.java
index 8010a58..4b1151e 100644
--- a/src/main/java/com/att/nsa/mr/tools/TopicCommand.java
+++ b/src/main/java/com/att/nsa/mr/tools/TopicCommand.java
@@ -25,6 +25,9 @@ import java.io.IOException;
import java.io.PrintStream;
import java.util.Set;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import com.att.nsa.apiClient.http.HttpException;
import com.att.nsa.apiClient.http.HttpObjectNotFoundException;
import com.att.nsa.cmdtool.Command;
@@ -35,7 +38,7 @@ import com.att.nsa.mr.client.MRTopicManager.TopicInfo;
public class TopicCommand implements Command<MRCommandContext>
{
-
+ final Logger logger = LoggerFactory.getLogger(ApiKeyCommand.class);
@Override
public String[] getMatches ()
{
@@ -117,10 +120,12 @@ public class TopicCommand implements Command<MRCommandContext>
catch ( IOException x )
{
out.println ( "Problem with request: " + x.getMessage () );
+ logger.error("IOException: ", x);
}
catch ( HttpObjectNotFoundException e )
{
out.println ( "Not found: " + e.getMessage () );
+ logger.error("HttpObjectNotFoundException: ", e);
}
}
else if ( parts[0].equals ( "create" ) )
@@ -135,14 +140,17 @@ public class TopicCommand implements Command<MRCommandContext>
catch ( HttpException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("HttpException: ", e);
}
catch ( IOException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("IOException: ", e);
}
catch ( NumberFormatException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("NumberFormatException: ", e);
}
}
else if ( parts[0].equals ( "grant" ) )
@@ -161,10 +169,12 @@ public class TopicCommand implements Command<MRCommandContext>
catch ( HttpException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("HttpException: ", e);
}
catch ( IOException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("IOException: ", e);
}
}
else if ( parts[0].equals ( "revoke" ) )
@@ -183,10 +193,12 @@ public class TopicCommand implements Command<MRCommandContext>
catch ( HttpException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("HttpException: ", e);
}
catch ( IOException e )
{
out.println ( "Problem with request: " + e.getMessage () );
+ logger.error("IOException: ", e);
}
}
}