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