aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/music/rest/RestMusicLocksAPI.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/music/rest/RestMusicLocksAPI.java')
-rw-r--r--src/main/java/org/onap/music/rest/RestMusicLocksAPI.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/onap/music/rest/RestMusicLocksAPI.java b/src/main/java/org/onap/music/rest/RestMusicLocksAPI.java
index 9189fbb3..22112ddf 100644
--- a/src/main/java/org/onap/music/rest/RestMusicLocksAPI.java
+++ b/src/main/java/org/onap/music/rest/RestMusicLocksAPI.java
@@ -412,7 +412,11 @@ public class RestMusicLocksAPI {
logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.UNKNOWNERROR ,ErrorSeverity.CRITICAL, ErrorTypes.GENERALSERVICEERROR);
return response.status(Status.BAD_REQUEST).entity(resultMap).build();
}
- MusicCore.deleteLock(lockName);
+ try{
+ MusicCore.deleteLock(lockName);
+ }catch (Exception e) {
+ return response.status(Status.BAD_REQUEST).entity(new JsonResponse(ResultType.FAILURE).setError(e.getMessage()).toMap()).build();
+ }
return response.status(Status.OK).entity(new JsonResponse(ResultType.SUCCESS).toMap()).build();
}