Package org.dynamoframework.rest
Class ControllerExceptionHandler
java.lang.Object
org.dynamoframework.rest.ControllerExceptionHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ErrorMessageResponse> constraintViolation(jakarta.validation.ConstraintViolationException ex) org.springframework.http.ResponseEntity<ErrorMessageResponse> org.springframework.http.ResponseEntity<ErrorMessageResponse> jsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException ex) org.springframework.http.ResponseEntity<ErrorMessageResponse> org.springframework.http.ResponseEntity<ErrorMessageResponse> org.springframework.http.ResponseEntity<ErrorMessageResponse> noResourceFound(org.springframework.web.servlet.resource.NoResourceFoundException ex) Called when the REST endpoint cannot be foundorg.springframework.http.ResponseEntity<ErrorMessageResponse> org.springframework.http.ResponseEntity<ErrorMessageResponse>
-
Constructor Details
-
ControllerExceptionHandler
public ControllerExceptionHandler()
-
-
Method Details
-
constraintViolation
@ExceptionHandler(jakarta.validation.ConstraintViolationException.class) @ResponseStatus(BAD_REQUEST) public org.springframework.http.ResponseEntity<ErrorMessageResponse> constraintViolation(jakarta.validation.ConstraintViolationException ex) -
jsonProcessingException
@ExceptionHandler(com.fasterxml.jackson.core.JsonProcessingException.class) @ResponseStatus(BAD_REQUEST) public org.springframework.http.ResponseEntity<ErrorMessageResponse> jsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException ex) -
noResourceFound
@ExceptionHandler(org.springframework.web.servlet.resource.NoResourceFoundException.class) @ResponseStatus(NOT_FOUND) public org.springframework.http.ResponseEntity<ErrorMessageResponse> noResourceFound(org.springframework.web.servlet.resource.NoResourceFoundException ex) Called when the REST endpoint cannot be found- Parameters:
ex- the exception that occurred- Returns:
- the error response message
-
noResourceFound
@ExceptionHandler(org.dynamoframework.exception.OcsNotFoundException.class) @ResponseStatus(NOT_FOUND) public org.springframework.http.ResponseEntity<ErrorMessageResponse> noResourceFound(OcsNotFoundException ex) -
validationError
@ExceptionHandler(org.dynamoframework.exception.OCSValidationException.class) @ResponseStatus(BAD_REQUEST) public org.springframework.http.ResponseEntity<ErrorMessageResponse> validationError(OCSValidationException ex) -
nonUniqueException
@ExceptionHandler(org.dynamoframework.exception.OCSNonUniqueException.class) @ResponseStatus(BAD_REQUEST) public org.springframework.http.ResponseEntity<ErrorMessageResponse> nonUniqueException(OCSNonUniqueException ex) -
securityException
@ExceptionHandler(org.dynamoframework.exception.OCSSecurityException.class) @ResponseStatus(UNAUTHORIZED) public org.springframework.http.ResponseEntity<ErrorMessageResponse> securityException(OCSSecurityException ex) -
fallback
@ExceptionHandler(java.lang.Exception.class) @ResponseStatus(BAD_REQUEST) public org.springframework.http.ResponseEntity<ErrorMessageResponse> fallback(Exception ex)
-