X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Frest%2FRestMusicLocksAPI.java;fp=src%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Frest%2FRestMusicLocksAPI.java;h=22112ddfcc2e247dbc4fca948e0e1f13c644198e;hb=587e3d75c651f97b6e11cc61d7159e607c3f0f90;hp=9189fbb397e8b0db05947d7f8200d9d6b9362ba6;hpb=0d0e1f6dcf7bb27f5604615772d55b8cc903e9c7;p=music.git 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(); }