Sonar critical issues 63/42663/1
authorSurendra Reddy Katam <SK00524980@techmahindra.com>
Fri, 13 Apr 2018 05:26:02 +0000 (10:56 +0530)
committerSurendra Reddy Katam <SK00524980@techmahindra.com>
Fri, 13 Apr 2018 05:26:02 +0000 (10:56 +0530)
Define and throw a dedicated exception instead of using a generic one
Sonar Link:
https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AV4-ValN32hFUzlqc5zj&resolved=false&severities=CRITICAL
Location:
src/main/java/com/att/nsa/cambria/service/impl/UIServiceImpl.java
Line No-118

Change-Id: Ief99865ceb889340c2895b023cede8c355052c19
Issue-ID: DMAAP-407
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
src/main/java/com/att/nsa/cambria/service/impl/UIServiceImpl.java

index 0fbf657..adebbd2 100644 (file)
@@ -115,7 +115,7 @@ public class UIServiceImpl implements UIService {
                        DMaaPResponseBuilder.respondOk(dmaapContext, key.asJsonObject());
                } else {
                        LOGGER.info("Details of apikey [" + apiKey + "] not found. Returning response");
-                       throw new Exception("Key [" + apiKey + "] not found.");
+                       throw new IOException("Key [" + apiKey + "] not found.");
                }
 
        }