Class ApiExceptionalHandler
java.lang.Object
io.mosip.kernel.ridgenerator.exception.ApiExceptionalHandler
Controller advice for RID generator service.
- Since:
- 1.0.0
- Author:
- Ritesh Sinha
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> defaultErrorHandler(jakarta.servlet.http.HttpServletRequest httpServletRequest, Exception exception) Method to handleRuntimeException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> emptyLengthException(jakarta.servlet.http.HttpServletRequest httpServletRequest, EmptyInputException e) Method to handleEmptyInputException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> inputLengthException(jakarta.servlet.http.HttpServletRequest httpServletRequest, InputLengthException e) Method to handleInputLengthException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> onHttpMessageNotReadable(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException exception) Method to handleHttpMessageNotReadableException.
-
Field Details
-
WHITESPACE
- See Also:
-
-
Constructor Details
-
ApiExceptionalHandler
public ApiExceptionalHandler()
-
-
Method Details
-
inputLengthException
@ExceptionHandler(InputLengthException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> inputLengthException(jakarta.servlet.http.HttpServletRequest httpServletRequest, InputLengthException e) throws IOException Method to handleInputLengthException.- Parameters:
httpServletRequest- servelet request.e- the exception.- Returns:
- the response.
- Throws:
IOException
-
emptyLengthException
@ExceptionHandler(EmptyInputException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> emptyLengthException(jakarta.servlet.http.HttpServletRequest httpServletRequest, EmptyInputException e) throws IOException Method to handleEmptyInputException.- Parameters:
httpServletRequest- servelet request.e- the exception.- Returns:
- the response.
- Throws:
IOException
-
onHttpMessageNotReadable
@ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> onHttpMessageNotReadable(jakarta.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException exception) throws IOException Method to handleHttpMessageNotReadableException.- Parameters:
exception- the exception.- Returns:
ErrorResponse.- Throws:
IOException
-
defaultErrorHandler
@ExceptionHandler({java.lang.Exception.class,java.lang.RuntimeException.class}) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> defaultErrorHandler(jakarta.servlet.http.HttpServletRequest httpServletRequest, Exception exception) throws IOException Method to handleRuntimeException.- Parameters:
exception- the exception.request- the servlet request.- Returns:
ErrorResponse.- Throws:
IOException
-