various Updates
[music.git] / src / main / java / org / onap / music / main / MusicCore.java
index abeedf6..dfc93cc 100644 (file)
@@ -518,14 +518,16 @@ public class MusicCore {
     /**
      * 
      * @param lockName
+     * @throws MusicLockingException 
      */
-    public static void deleteLock(String lockName) {
+    public static void deleteLock(String lockName) throws MusicLockingException {
         long start = System.currentTimeMillis();
         logger.info(EELFLoggerDelegate.applicationLogger,"Deleting lock for " + lockName);
         try {
             getLockingServiceHandle().deleteLock("/" + lockName);
         } catch (MusicLockingException e) {
                logger.error(EELFLoggerDelegate.errorLogger,e.getMessage(), AppMessages.DELTELOCK+lockName  ,ErrorSeverity.CRITICAL, ErrorTypes.LOCKINGERROR);
+               throw new MusicLockingException(e.getMessage());
         }
         long end = System.currentTimeMillis();
         logger.info(EELFLoggerDelegate.applicationLogger,"Time taken to delete lock:" + (end - start) + " ms");
@@ -890,7 +892,13 @@ public class MusicCore {
                         operation);
         if (!resultMap.isEmpty())
             return resultMap;
-        String isAAFApp = CachingUtil.isAAFApplication(nameSpace);
+        String isAAFApp = null;
+        try {
+            isAAFApp= CachingUtil.isAAFApplication(nameSpace);
+        } catch(MusicServiceException e) {
+           resultMap.put("Exception", e.getMessage());
+           return resultMap;
+        }
         if(isAAFApp == null) {
             resultMap.put("Exception", "Namespace: "+nameSpace+" doesn't exist. Please make sure ns(appName)"
                     + " is correct and Application is onboarded.");