Class ApiExceptionalHandler
- java.lang.Object
-
- io.mosip.kernel.ridgenerator.exception.ApiExceptionalHandler
-
@RestControllerAdvice public class ApiExceptionalHandler extends Object
Controller advice for RID generator service.- Since:
- 1.0.0
- Author:
- Ritesh Sinha
-
-
Field Summary
Fields Modifier and Type Field Description static StringWHITESPACE
-
Constructor Summary
Constructors Constructor Description ApiExceptionalHandler()
-
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 exception)Method to handleRuntimeException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>emptyLengthException(javax.servlet.http.HttpServletRequest httpServletRequest, EmptyInputException e)Method to handleEmptyInputException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>inputLengthException(javax.servlet.http.HttpServletRequest httpServletRequest, InputLengthException e)Method to handleInputLengthException.org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>>onHttpMessageNotReadable(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException exception)Method to handleHttpMessageNotReadableException.
-
-
-
Field Detail
-
WHITESPACE
public static final String WHITESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
inputLengthException
@ExceptionHandler(InputLengthException.class) public org.springframework.http.ResponseEntity<ResponseWrapper<ServiceError>> inputLengthException(javax.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(javax.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(javax.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(javax.servlet.http.HttpServletRequest httpServletRequest, Exception exception) throws IOExceptionMethod to handleRuntimeException.- Parameters:
request- the servlet request.exception- the exception.- Returns:
ErrorResponse.- Throws:
IOException
-
-