Class ApiExceptionHandler
- java.lang.Object
-
- io.mosip.kernel.smsserviceprovider.msg91.exception.ApiExceptionHandler
-
@Order(2147483647) @RestControllerAdvice public class ApiExceptionHandler extends Object
Class for handling exceptions.- Since:
- 1.0.0
- Author:
- Urvil Joshi
-
-
Constructor Summary
Constructors Constructor Description ApiExceptionHandler()
-
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>>httpServerErrorException(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.client.HttpServerErrorException exception)org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>onHttpMessageNotReadable(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException e)This method handle HttpMessageNotReadableException type of exception.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>smsInvalidInputsFound(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException exception)This method handles MethodArgumentNotValidException type of exceptions.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>smsNotificationInvalidNumber(javax.servlet.http.HttpServletRequest httpServletRequest, InvalidNumberException e)This method handles MosipInvalidNumberException type of exceptions.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>smsVendorServiceException(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.client.HttpClientErrorException e)This method handle HttpClientErrorException type of exception.
-
-
-
Method Detail
-
smsInvalidInputsFound
@ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> smsInvalidInputsFound(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException exception) throws IOException
This method handles MethodArgumentNotValidException type of exceptions.- Parameters:
httpServletRequest- the requestexception- The exception- Returns:
- The response entity.
- Throws:
IOException- the IOException
-
smsNotificationInvalidNumber
@ExceptionHandler(io.mosip.kernel.core.notification.exception.InvalidNumberException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> smsNotificationInvalidNumber(javax.servlet.http.HttpServletRequest httpServletRequest, InvalidNumberException e) throws IOException
This method handles MosipInvalidNumberException type of exceptions.- Parameters:
httpServletRequest- the requeste- The exception- Returns:
- The response entity.
- Throws:
IOException- the 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
This method handle HttpMessageNotReadableException type of exception.- Parameters:
httpServletRequest- the request.e- the exception.- Returns:
- the response entity.
- Throws:
IOException- IOException.
-
smsVendorServiceException
@ExceptionHandler(org.springframework.web.client.HttpClientErrorException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> smsVendorServiceException(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.client.HttpClientErrorException e) throws IOException
This method handle HttpClientErrorException type of exception.- Parameters:
httpServletRequest- the request.e- the exception.- Returns:
- the response entity.
- Throws:
IOException- IOException.
-
httpServerErrorException
@ExceptionHandler(org.springframework.web.client.HttpServerErrorException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> httpServerErrorException(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.client.HttpServerErrorException exception) 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
-
-