summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2024-07-01 11:24:49 +0100
committerToineSiebelink <toine.siebelink@est.tech>2024-07-01 11:24:49 +0100
commit3d82cce6c14838c54dd9852a8fdac20b01ad0925 (patch)
tree6dda1e7e9364c2dcdeecbb07289fa095e6f07dde /cps-ncmp-rest/src/main
parent98d9ac273754a8637bb5e08b1ec7c0b98c645e9e (diff)
Improve handling of Invalid Operation exception
- MOve to API package - Handle in REST Controller to return BAD REQUEST Issue-ID: CPS-2256 Change-Id: I4f96519aaf2e7f781729c8b8671ea02630a2e0a8 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/main')
-rw-r--r--cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java
index 6539f9bfac..d8bc73a3a5 100644
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyRestExceptionHandler.java
@@ -24,6 +24,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.ncmp.api.data.exceptions.InvalidDatastoreException;
+import org.onap.cps.ncmp.api.data.exceptions.InvalidOperationException;
import org.onap.cps.ncmp.api.data.exceptions.OperationNotSupportedException;
import org.onap.cps.ncmp.api.impl.exception.DmiClientRequestException;
import org.onap.cps.ncmp.api.impl.exception.DmiRequestException;
@@ -77,9 +78,9 @@ public class NetworkCmProxyRestExceptionHandler {
return wrapDmiErrorResponse(dmiClientRequestException);
}
- @ExceptionHandler({DmiRequestException.class, DataValidationException.class, OperationNotSupportedException.class,
- HttpMessageNotReadableException.class, InvalidTopicException.class, InvalidDatastoreException.class,
- InvalidDmiResourceUrlException.class})
+ @ExceptionHandler({DmiRequestException.class, DataValidationException.class, InvalidOperationException.class,
+ OperationNotSupportedException.class, HttpMessageNotReadableException.class, InvalidTopicException.class,
+ InvalidDatastoreException.class, InvalidDmiResourceUrlException.class})
public static ResponseEntity<Object> handleDmiRequestExceptions(final Exception exception) {
return buildErrorResponse(HttpStatus.BAD_REQUEST, exception);
}