Class OtpControllerAdvice


  • @RestControllerAdvice
    public class OtpControllerAdvice
    extends Object
    Central class for handling exceptions.
    Since:
    1.0.0
    Author:
    Ritesh Sinha, Sagar Mahapatra
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> defaultErrorHandler​(javax.servlet.http.HttpServletRequest httpServletRequest, Exception e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onHttpMessageNotReadable​(org.springframework.http.converter.HttpMessageNotReadableException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> otpGeneratorValidity​(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException e)
      This method handles MethodArgumentNotValidException.
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> otpValidationArgumentValidity​(javax.servlet.http.HttpServletRequest httpServletRequest, OtpInvalidArgumentException exception)
      This method handles OtpInvalidArgumentException.
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> otpValidationKeyNullValidity​(javax.servlet.http.HttpServletRequest httpServletRequest, RequiredKeyNotFoundException exception)
      This method handles RequiredKeyNotFoundException.
    • Constructor Detail

      • OtpControllerAdvice

        public OtpControllerAdvice()
    • Method Detail

      • otpGeneratorValidity

        @ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> otpGeneratorValidity​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                    org.springframework.web.bind.MethodArgumentNotValidException e)
                                                                                                                                                             throws IOException
        This method handles MethodArgumentNotValidException.
        Parameters:
        httpServletRequest - the request
        e - The exception
        Returns:
        The response entity.
        Throws:
        IOException - the IO Exception
      • otpValidationArgumentValidity

        @ExceptionHandler(OtpInvalidArgumentException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> otpValidationArgumentValidity​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                             OtpInvalidArgumentException exception)
                                                                                                                                                                      throws IOException
        This method handles OtpInvalidArgumentException.
        Parameters:
        httpServletRequest - the request
        exception - The exception.
        Returns:
        The response entity.
        Throws:
        IOException - the IO Exception
      • otpValidationKeyNullValidity

        @ExceptionHandler(RequiredKeyNotFoundException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> otpValidationKeyNullValidity​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                            RequiredKeyNotFoundException exception)
                                                                                                                                                                     throws IOException
        This method handles RequiredKeyNotFoundException.
        Parameters:
        httpServletRequest - the request
        exception - The exception.
        Returns:
        The response entity.
        Throws:
        IOException - the IO Exception
      • 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​(org.springframework.http.converter.HttpMessageNotReadableException e)