Class KeymanagerExceptionHandler
java.lang.Object
io.mosip.kernel.keymanagerservice.exception.KeymanagerExceptionHandler
Rest Controller Advice for Keymanager Service
- Since:
- 1.0.0
- Author:
- Dharmesh Khandelwal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> certificateNotValidException(jakarta.servlet.http.HttpServletRequest httpServletRequest, CertificateNotValidException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> controlRequestException(jakarta.servlet.http.HttpServletRequest httpServletRequest, RequestException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoException(jakarta.servlet.http.HttpServletRequest httpServletRequest, CryptoException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoManagerServieException(jakarta.servlet.http.HttpServletRequest httpServletRequest, CryptoManagerSerivceException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> dateTimeParseException(jakarta.servlet.http.HttpServletRequest httpServletRequest, DateTimeParseException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> defaultErrorHandler(jakarta.servlet.http.HttpServletRequest httpServletRequest, Exception e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> emptyLengthException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.idgenerator.exception.TokenIdGeneratorException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> handleServiceException(jakarta.servlet.http.HttpServletRequest httpServletRequest, LicenseKeyServiceException exception) Method to handleLicenseKeyServiceException.org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> illegalArgumentException(jakarta.servlet.http.HttpServletRequest httpServletRequest, IllegalArgumentException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidApplicationIdException(jakarta.servlet.http.HttpServletRequest httpServletRequest, InvalidApplicationIdException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidDataException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.InvalidDataException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidFormatException(jakarta.servlet.http.HttpServletRequest httpServletRequest, com.fasterxml.jackson.databind.exc.InvalidFormatException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidKeyException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.InvalidKeyException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keymanagerServiceException(jakarta.servlet.http.HttpServletRequest httpServletRequest, KeymanagerServiceException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keystoreProcessingException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.keymanager.exception.KeystoreProcessingException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> methodArgumentNotValidException(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noSuchAlgorithmException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.exception.NoSuchAlgorithmException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noUniqueAliasException(jakarta.servlet.http.HttpServletRequest httpServletRequest, NoUniqueAliasException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> nullDataException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.NullDataException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onHttpMessageNotReadable(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onMissingServletRequestParameterException(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MissingServletRequestParameterException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> parseResponseException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.ParseResponseException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> partnerCertManagerException(jakarta.servlet.http.HttpServletRequest httpServletRequest, PartnerCertManagerException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureFailureException(jakarta.servlet.http.HttpServletRequest httpServletRequest, SignatureFailureException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilClientException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.SignatureUtilClientException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.SignatureUtilException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> validateInputArguments(jakarta.servlet.http.HttpServletRequest httpServletRequest, InvalidArgumentsException exception) Method to handleInvalidArgumentsException.org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkCryptoException(jakarta.servlet.http.HttpServletRequest httpServletRequest, ZKCryptoException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkKeyDerivationException(jakarta.servlet.http.HttpServletRequest httpServletRequest, ZKKeyDerivationException e) org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkRandomKeyDecryptionException(jakarta.servlet.http.HttpServletRequest httpServletRequest, ZKRandomKeyDecryptionException e)
-
Constructor Details
-
KeymanagerExceptionHandler
public KeymanagerExceptionHandler()
-
-
Method Details
-
nullDataException
@ExceptionHandler(io.mosip.kernel.core.crypto.exception.NullDataException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> nullDataException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.NullDataException e) throws IOException - Throws:
IOException
-
invalidKeyException
@ExceptionHandler(io.mosip.kernel.core.crypto.exception.InvalidKeyException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidKeyException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.InvalidKeyException e) throws IOException - Throws:
IOException
-
noSuchAlgorithmException
@ExceptionHandler(io.mosip.kernel.core.exception.NoSuchAlgorithmException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noSuchAlgorithmException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.exception.NoSuchAlgorithmException e) throws IOException - Throws:
IOException
-
illegalArgumentException
@ExceptionHandler(java.lang.IllegalArgumentException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> illegalArgumentException(jakarta.servlet.http.HttpServletRequest httpServletRequest, IllegalArgumentException e) throws IOException - Throws:
IOException
-
invalidFormatException
@ExceptionHandler(com.fasterxml.jackson.databind.exc.InvalidFormatException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidFormatException(jakarta.servlet.http.HttpServletRequest httpServletRequest, com.fasterxml.jackson.databind.exc.InvalidFormatException e) throws IOException - Throws:
IOException
-
dateTimeParseException
@ExceptionHandler(java.time.format.DateTimeParseException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> dateTimeParseException(jakarta.servlet.http.HttpServletRequest httpServletRequest, DateTimeParseException e) throws IOException - Throws:
IOException
-
invalidDataException
@ExceptionHandler(io.mosip.kernel.core.crypto.exception.InvalidDataException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidDataException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.InvalidDataException e) throws IOException - Throws:
IOException
-
noUniqueAliasException
@ExceptionHandler(NoUniqueAliasException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noUniqueAliasException(jakarta.servlet.http.HttpServletRequest httpServletRequest, NoUniqueAliasException e) throws IOException - Throws:
IOException
-
cryptoException
@ExceptionHandler(CryptoException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoException(jakarta.servlet.http.HttpServletRequest httpServletRequest, CryptoException e) throws IOException - Throws:
IOException
-
keymanagerServiceException
@ExceptionHandler(KeymanagerServiceException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keymanagerServiceException(jakarta.servlet.http.HttpServletRequest httpServletRequest, KeymanagerServiceException e) throws IOException - Throws:
IOException
-
cryptoManagerServieException
@ExceptionHandler(CryptoManagerSerivceException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoManagerServieException(jakarta.servlet.http.HttpServletRequest httpServletRequest, CryptoManagerSerivceException e) throws IOException - Throws:
IOException
-
invalidApplicationIdException
@ExceptionHandler(InvalidApplicationIdException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidApplicationIdException(jakarta.servlet.http.HttpServletRequest httpServletRequest, InvalidApplicationIdException e) throws IOException - Throws:
IOException
-
methodArgumentNotValidException
@ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> methodArgumentNotValidException(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException e) throws IOException - Throws:
IOException
-
onHttpMessageNotReadable
@ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onHttpMessageNotReadable(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException e) throws IOException - Throws:
IOException
-
onMissingServletRequestParameterException
@ExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onMissingServletRequestParameterException(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MissingServletRequestParameterException e) throws IOException - Throws:
IOException
-
emptyLengthException
@ExceptionHandler(io.mosip.kernel.core.idgenerator.exception.TokenIdGeneratorException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> emptyLengthException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.idgenerator.exception.TokenIdGeneratorException e) throws IOException - Throws:
IOException
-
zkCryptoException
@ExceptionHandler(ZKCryptoException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkCryptoException(jakarta.servlet.http.HttpServletRequest httpServletRequest, ZKCryptoException e) throws IOException - Throws:
IOException
-
zkKeyDerivationException
@ExceptionHandler(ZKKeyDerivationException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkKeyDerivationException(jakarta.servlet.http.HttpServletRequest httpServletRequest, ZKKeyDerivationException e) throws IOException - Throws:
IOException
-
zkRandomKeyDecryptionException
@ExceptionHandler(ZKRandomKeyDecryptionException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkRandomKeyDecryptionException(jakarta.servlet.http.HttpServletRequest httpServletRequest, ZKRandomKeyDecryptionException e) throws IOException - Throws:
IOException
-
partnerCertManagerException
@ExceptionHandler(PartnerCertManagerException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> partnerCertManagerException(jakarta.servlet.http.HttpServletRequest httpServletRequest, PartnerCertManagerException e) throws IOException - Throws:
IOException
-
keystoreProcessingException
@ExceptionHandler(io.mosip.kernel.core.keymanager.exception.KeystoreProcessingException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keystoreProcessingException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.keymanager.exception.KeystoreProcessingException e) throws IOException - Throws:
IOException
-
validateInputArguments
@ExceptionHandler(InvalidArgumentsException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> validateInputArguments(jakarta.servlet.http.HttpServletRequest httpServletRequest, InvalidArgumentsException exception) throws IOException Method to handleInvalidArgumentsException.- Parameters:
httpServletRequest- the requestexception- the exception.- Returns:
ErrorResponse.- Throws:
IOException- the IO exception
-
certificateNotValidException
@ExceptionHandler(CertificateNotValidException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> certificateNotValidException(jakarta.servlet.http.HttpServletRequest httpServletRequest, CertificateNotValidException e) throws IOException - Throws:
IOException
-
handleServiceException
@ExceptionHandler(LicenseKeyServiceException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> handleServiceException(jakarta.servlet.http.HttpServletRequest httpServletRequest, LicenseKeyServiceException exception) throws IOException Method to handleLicenseKeyServiceException.- Parameters:
httpServletRequest- the requestexception- the exception.- Returns:
ErrorResponse.- Throws:
IOException- the IO exception
-
controlRequestException
@ExceptionHandler(RequestException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> controlRequestException(jakarta.servlet.http.HttpServletRequest httpServletRequest, RequestException e) throws IOException - Throws:
IOException
-
signatureFailureException
@ExceptionHandler(SignatureFailureException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureFailureException(jakarta.servlet.http.HttpServletRequest httpServletRequest, SignatureFailureException e) throws IOException - Throws:
IOException
-
signatureUtilClientException
@ExceptionHandler(io.mosip.kernel.core.signatureutil.exception.SignatureUtilClientException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilClientException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.SignatureUtilClientException e) throws IOException - Throws:
IOException
-
signatureUtilException
@ExceptionHandler(io.mosip.kernel.core.signatureutil.exception.SignatureUtilException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.SignatureUtilException e) throws IOException - Throws:
IOException
-
parseResponseException
@ExceptionHandler(io.mosip.kernel.core.signatureutil.exception.ParseResponseException.class) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> parseResponseException(jakarta.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.ParseResponseException e) throws IOException - Throws:
IOException
-
defaultErrorHandler
@ExceptionHandler({java.lang.Exception.class,java.lang.RuntimeException.class}) public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> defaultErrorHandler(jakarta.servlet.http.HttpServletRequest httpServletRequest, Exception e) throws IOException - Throws:
IOException
-