summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvarun gudisena <vg411h@att.com>2017-09-23 00:02:33 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-23 00:02:33 +0000
commit22f00318d3dafa07e36b947ed1dc618f44714a08 (patch)
treec760a3b9548375cd33d6e46fe863485f4f8f05e1
parent16ddd05cd07ca9fcb2ea2d7fc8228f2258f85db5 (diff)
parent6897272aefdaa9d070c162991cbb6154c2be79b3 (diff)
Merge "Fix for sonar critical issues"
-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);
}
}
}