Package com.skava.oms.web.handler
Class OmsExceptionHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
com.skava.oms.web.handler.OmsExceptionHandler
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.MessageSourceAware
@ControllerAdvice
@Order(-2147483648)
public class OmsExceptionHandler
extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
This class defines the Exception Handler to handle the collection request.
- Since:
- 02-Jul-2018
- Author:
- Infosys Equinox
-
Field Summary
Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.audit4j.core.dto.Field>
getAuditFields
(org.springframework.web.context.request.WebRequest request) getAuditFieldsorg.springframework.http.ResponseEntity<Object>
handleCommonPluginException
(CommonPluginServiceException exception, org.springframework.web.context.request.WebRequest request) protected org.springframework.http.ResponseEntity<Object>
handleHttpMessageNotReadable
(org.springframework.http.converter.HttpMessageNotReadableException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) This method is used to create ResponseEntity.protected org.springframework.http.ResponseEntity<Object>
handleMethodArgumentNotValid
(org.springframework.web.bind.MethodArgumentNotValidException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) This method is used to create ResponseEntity.org.springframework.http.ResponseEntity<Object>
handleOmsServiceException
(OmsServiceException exception, org.springframework.web.context.request.WebRequest request) This method is used to create ResponseEntity.final org.springframework.http.ResponseEntity<Object>
handleValidateException
(Exception ex, org.springframework.web.context.request.WebRequest request) handleValidateException.Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestNotUsableException, handleAsyncRequestTimeoutException, handleConversionNotSupported, handleErrorResponseException, handleException, handleExceptionInternal, handleHandlerMethodValidationException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMaxUploadSizeExceededException, handleMethodValidationException, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleNoResourceFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource
-
Constructor Details
-
OmsExceptionHandler
public OmsExceptionHandler()
-
-
Method Details
-
handleOmsServiceException
@ExceptionHandler(OmsServiceException.class) public org.springframework.http.ResponseEntity<Object> handleOmsServiceException(OmsServiceException exception, org.springframework.web.context.request.WebRequest request) This method is used to create ResponseEntity.- Parameters:
exception
- It contains the exception required for the creation of response message.request
- It contains the attributes required for the creation of response message.- Returns:
- It returns the
ResponseEntity
.
-
handleCommonPluginException
@ExceptionHandler(CommonPluginServiceException.class) public org.springframework.http.ResponseEntity<Object> handleCommonPluginException(CommonPluginServiceException exception, org.springframework.web.context.request.WebRequest request) -
handleMethodArgumentNotValid
protected org.springframework.http.ResponseEntity<Object> handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) This method is used to create ResponseEntity.- Overrides:
handleMethodArgumentNotValid
in classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
- Parameters:
exception
- It contains the exception required for the creation of response message.headers
- It contains the attributes required for the creation of response message.status
- It contains the attributes required for the creation of response message.request
- It contains the attributes required for the creation of response message.- Returns:
- It returns the
ResponseEntity
.
-
handleValidateException
@ExceptionHandler(OmsValidateException.class) public final org.springframework.http.ResponseEntity<Object> handleValidateException(Exception ex, org.springframework.web.context.request.WebRequest request) handleValidateException.
Handles the Exception of type $@link OmsValidateException} and fetch the exception details and send the response as httpStatus,- Parameters:
ex
- aException
object.request
- aWebRequest
object.- Returns:
- a
ResponseEntity
object.
-
handleHttpMessageNotReadable
protected org.springframework.http.ResponseEntity<Object> handleHttpMessageNotReadable(org.springframework.http.converter.HttpMessageNotReadableException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode status, org.springframework.web.context.request.WebRequest request) This method is used to create ResponseEntity.- Overrides:
handleHttpMessageNotReadable
in classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
- Parameters:
exception
- It contains the exception required for the creation of response message.headers
- It contains the attributes required for the creation of response message.status
- It contains the attributes required for the creation of response message.request
- It contains the attributes required for the creation of response message.- Returns:
- It returns the
ResponseEntity
.
-
getAuditFields
public static List<org.audit4j.core.dto.Field> getAuditFields(org.springframework.web.context.request.WebRequest request) getAuditFields- Parameters:
request
-- Returns:
-