diff options
author | rama-huawei <rama.subba.reddy.s@huawei.com> | 2017-09-15 15:07:19 +0530 |
---|---|---|
committer | Rama SubbaReddy <rama.subba.reddy.s@huawei.com> | 2017-09-15 09:45:11 +0000 |
commit | 547a353b8329b253f032b9889ea1cf97a6d3469d (patch) | |
tree | 4ab81dc8260abd6e259b03a5e2c04f1039464567 /src/main/java/com | |
parent | a9692dd1ffe49fe5835fc8c27838338d13fd66f2 (diff) |
Fix for Sonar critical issues
DCAEGEN2-93
Change-Id: Ibe82902d410bbed99e0d628c0ac63d17a4b94a34
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/att/nsa/mr/tools/MessageCommand.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/com/att/nsa/mr/tools/MessageCommand.java b/src/main/java/com/att/nsa/mr/tools/MessageCommand.java index 2c646bf..97216c4 100644 --- a/src/main/java/com/att/nsa/mr/tools/MessageCommand.java +++ b/src/main/java/com/att/nsa/mr/tools/MessageCommand.java @@ -26,6 +26,9 @@ import java.io.PrintStream; import java.util.List; import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.att.nsa.cmdtool.Command; import com.att.nsa.cmdtool.CommandNotReadyException; import com.att.nsa.mr.client.MRBatchingPublisher; @@ -36,7 +39,7 @@ import com.att.nsa.mr.client.MRPublisher.message; public class MessageCommand implements Command<MRCommandContext> { - + final Logger logger = LoggerFactory.getLogger(ApiKeyCommand.class); @Override public String[] getMatches () { @@ -73,6 +76,7 @@ public class MessageCommand implements Command<MRCommandContext> catch ( Exception e ) { out.println ( "Problem fetching messages: " + e.getMessage() ); + logger.error("Problem fetching messages: ", e); } finally { @@ -94,6 +98,7 @@ public class MessageCommand implements Command<MRCommandContext> catch ( IOException e ) { out.println ( "Problem sending message: " + e.getMessage() ); + logger.error("Problem sending message: ", e); } finally { @@ -105,10 +110,12 @@ public class MessageCommand implements Command<MRCommandContext> catch ( IOException e ) { out.println ( "Problem sending message: " + e.getMessage() ); + logger.error("Problem sending message: ", e); } catch ( InterruptedException e ) { out.println ( "Problem sending message: " + e.getMessage() ); + logger.error("Problem sending message: ", e); } if ( left != null && left.size () > 0 ) { |