Class OtpControllerAdvice
- java.lang.Object
-
- io.mosip.kernel.otpmanager.exception.OtpControllerAdvice
-
@RestControllerAdvice public class OtpControllerAdvice extends Object
Central class for handling exceptions.- Since:
- 1.0.0
- Author:
- Ritesh Sinha, Sagar Mahapatra
-
-
Constructor Summary
Constructors Constructor Description OtpControllerAdvice()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>defaultErrorHandler(javax.servlet.http.HttpServletRequest httpServletRequest, Exception e)org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>onHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException e)org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>otpGeneratorValidity(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException e)This method handles MethodArgumentNotValidException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>otpValidationArgumentValidity(javax.servlet.http.HttpServletRequest httpServletRequest, OtpInvalidArgumentException exception)This method handles OtpInvalidArgumentException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>otpValidationKeyNullValidity(javax.servlet.http.HttpServletRequest httpServletRequest, RequiredKeyNotFoundException exception)This method handles RequiredKeyNotFoundException.
-
-
-
Method Detail
-
otpGeneratorValidity
@ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> otpGeneratorValidity(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException e) throws IOException
This method handles MethodArgumentNotValidException.- Parameters:
httpServletRequest- the requeste- The exception- Returns:
- The response entity.
- Throws:
IOException- the IO Exception
-
otpValidationArgumentValidity
@ExceptionHandler(OtpInvalidArgumentException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> otpValidationArgumentValidity(javax.servlet.http.HttpServletRequest httpServletRequest, OtpInvalidArgumentException exception) throws IOException
This method handles OtpInvalidArgumentException.- Parameters:
httpServletRequest- the requestexception- The exception.- Returns:
- The response entity.
- Throws:
IOException- the IO Exception
-
otpValidationKeyNullValidity
@ExceptionHandler(RequiredKeyNotFoundException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> otpValidationKeyNullValidity(javax.servlet.http.HttpServletRequest httpServletRequest, RequiredKeyNotFoundException exception) throws IOException
This method handles RequiredKeyNotFoundException.- Parameters:
httpServletRequest- the requestexception- The exception.- Returns:
- The response entity.
- Throws:
IOException- the IO Exception
-
onHttpMessageNotReadable
@ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> onHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException e)
-
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
-
-