package org.onap.oom.certservice.api.advice;
import org.onap.oom.certservice.api.CertificationController;
+import org.onap.oom.certservice.certification.exception.CertificateDecryptionException;
import org.onap.oom.certservice.certification.exception.Cmpv2ClientAdapterException;
import org.onap.oom.certservice.certification.exception.Cmpv2ServerNotFoundException;
import org.onap.oom.certservice.certification.exception.CsrDecryptionException;
);
}
+ @ExceptionHandler(value = CertificateDecryptionException.class)
+ public ResponseEntity<ErrorResponseModel> handle(CertificateDecryptionException exception) {
+ LOGGER.error("Exception occurred decoding certificate:", exception);
+ return getErrorResponseEntity(
+ "Wrong certificate format",
+ HttpStatus.BAD_REQUEST
+ );
+ }
+
@ExceptionHandler(value = Cmpv2ServerNotFoundException.class)
public ResponseEntity<ErrorResponseModel> handle(Cmpv2ServerNotFoundException exception) {
LOGGER.error("Exception occurred selecting CMPv2 server:", exception);