diff options
Diffstat (limited to 'cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java')
-rw-r--r-- | cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java index fa6fa28..d20e9f3 100644 --- a/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java +++ b/cps-tbdmt-rest/src/main/java/org/onap/cps/tbdmt/exception/TemplateExceptionHandler.java @@ -1,21 +1,22 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - * ================================================================================ - * Copyright (C) 2021 Wipro Limited. - * ================================================================================ - * 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 +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Wipro Limited. + * Modifications Copyright (C) 2023 Nordix Foundation + * ================================================================================ + * 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 + * 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========================================================= + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= */ package org.onap.cps.tbdmt.exception; @@ -25,6 +26,7 @@ import java.util.List; import org.onap.cps.tbdmt.model.ErrorResponse; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; import org.springframework.http.ResponseEntity; import org.springframework.validation.ObjectError; import org.springframework.web.bind.MethodArgumentNotValidException; @@ -70,8 +72,8 @@ public class TemplateExceptionHandler extends ResponseEntityExceptionHandler { @Override protected ResponseEntity<Object> handleMethodArgumentNotValid( - final MethodArgumentNotValidException methodArgumentNotValidException, final HttpHeaders httpHeaders, - final HttpStatus httpStatus, final WebRequest webRequest) { + final MethodArgumentNotValidException methodArgumentNotValidException, final HttpHeaders httpHeaders, + final HttpStatusCode httpStatus, final WebRequest webRequest) { final List<String> details = new ArrayList<>(); for (final ObjectError objectError : methodArgumentNotValidException.getBindingResult().getAllErrors()) { details.add(objectError.getDefaultMessage()); |