X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=rapp-manager-models%2Fsrc%2Fmain%2Fjava%2Fcom%2Foransc%2Frappmanager%2Fmodels%2Fexception%2FExceptionControllerHandler.java;h=ae26a5e4de285eff8bc6a10d68d21f40609d642b;hb=4b54b7ed29e736b2f80878bab90acaedb4e7117e;hp=1d66173f6d58cf29cfe3747c94a5cd342e984bd9;hpb=d01a7931b29554786a41c7212ba00fdc810a80a7;p=nonrtric%2Fplt%2Frappmanager.git diff --git a/rapp-manager-models/src/main/java/com/oransc/rappmanager/models/exception/ExceptionControllerHandler.java b/rapp-manager-models/src/main/java/com/oransc/rappmanager/models/exception/ExceptionControllerHandler.java index 1d66173..ae26a5e 100755 --- a/rapp-manager-models/src/main/java/com/oransc/rappmanager/models/exception/ExceptionControllerHandler.java +++ b/rapp-manager-models/src/main/java/com/oransc/rappmanager/models/exception/ExceptionControllerHandler.java @@ -1,3 +1,21 @@ +/* + * ============LICENSE_START====================================================================== + * Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. + * =============================================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END======================================================================== + */ + package com.oransc.rappmanager.models.exception; import org.springframework.http.ResponseEntity; @@ -12,4 +30,11 @@ public class ExceptionControllerHandler { return ResponseEntity.status(rappHandlerException.getStatusCode()) .body(new ErrorResponse(rappHandlerException.getMessage())); } + + @ExceptionHandler(RappValidationException.class) + public ResponseEntity handleRappValidationException( + RappValidationException rappValidationException) { + return ResponseEntity.status(rappValidationException.getStatusCode()) + .body(new ErrorResponse(rappValidationException.getMessage())); + } }