From e557338803286d8aaa0f877aa25d52d18735f309 Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Thu, 27 Jan 2022 17:12:52 +0000 Subject: Create Endpoint For Get Cm Handles By Name Create endpoint and implement logic for get cm handle details by cm handle name Issue-ID: CPS-817 Change-Id: I83bd2da9219d13fac715a08b19108028ca6f6751 Signed-off-by: DylanB95EST --- .../onap/cps/rest/exceptions/CpsRestExceptionHandler.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'cps-rest/src/main') diff --git a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java index ceb5dc1ec..9495b3d9e 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java @@ -63,30 +63,25 @@ public class CpsRestExceptionHandler { } @ExceptionHandler({ModelValidationException.class, DataValidationException.class, CpsAdminException.class, - CpsPathException.class}) - public static ResponseEntity handleBadRequestExceptions(final CpsException exception) { + CpsPathException.class, ValidationException.class}) + public static ResponseEntity handleBadRequestExceptions(final Exception exception) { return buildErrorResponse(HttpStatus.BAD_REQUEST, exception); } - @ExceptionHandler({ValidationException.class}) - public static ResponseEntity handleBadRequestExceptions(final ValidationException validationException) { - return buildErrorResponse(HttpStatus.BAD_REQUEST, validationException); - } - @ExceptionHandler({NotFoundInDataspaceException.class, DataNodeNotFoundException.class}) - public static ResponseEntity handleNotFoundExceptions(final CpsException exception, + public static ResponseEntity handleNotFoundExceptions(final Exception exception, final HttpServletRequest request) { return buildErrorResponse(HttpMethod.GET.matches(request.getMethod()) ? HttpStatus.NOT_FOUND : HttpStatus.BAD_REQUEST, exception); } @ExceptionHandler({DataInUseException.class, AlreadyDefinedException.class}) - public static ResponseEntity handleDataInUseException(final CpsException exception) { + public static ResponseEntity handleDataInUseException(final Exception exception) { return buildErrorResponse(HttpStatus.CONFLICT, exception); } @ExceptionHandler({CpsException.class}) - public static ResponseEntity handleAnyOtherCpsExceptions(final CpsException exception) { + public static ResponseEntity handleAnyOtherCpsExceptions(final Exception exception) { return buildErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, exception); } -- cgit 1.2.3-korg