Package org.ehrbase.rest
Class DefaultExceptionHandler
java.lang.Object
org.ehrbase.rest.DefaultExceptionHandler
@RestControllerAdvice(basePackages={"org.ehrbase.rest.openehr","org.ehrbase.rest.admin"})
public class DefaultExceptionHandler
extends Object
Default exception handler.
- Since:
- 1.0.0
- Author:
- Renaud Subiger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>org.springframework.http.ResponseEntity<Object>org.springframework.http.ResponseEntity<Object>org.springframework.http.ResponseEntity<Object>handleObjectNotFoundException(org.springframework.security.access.AccessDeniedException ex) org.springframework.http.ResponseEntity<Object>org.springframework.http.ResponseEntity<Object>handleSpringResponseStatusException(org.springframework.web.server.ResponseStatusException ex) org.springframework.http.ResponseEntity<Object>org.springframework.http.ResponseEntity<Object>org.springframework.http.ResponseEntity<Object>handleUnprocessableEntityException(UnprocessableEntityException ex, org.springframework.web.context.request.WebRequest request) org.springframework.http.ResponseEntity<Object>
-
Constructor Details
-
DefaultExceptionHandler
public DefaultExceptionHandler()
-
-
Method Details
-
handleBadRequestExceptions
@ExceptionHandler({org.springframework.http.converter.HttpMessageNotReadableException.class,org.springframework.web.method.annotation.MethodArgumentTypeMismatchException.class,org.springframework.web.multipart.support.MissingServletRequestPartException.class,org.springframework.validation.BindException.class,org.springframework.web.bind.ServletRequestBindingException.class,java.lang.IllegalArgumentException.class,org.ehrbase.api.exception.GeneralRequestProcessingException.class,org.ehrbase.api.exception.InvalidApiParameterException.class,org.ehrbase.api.exception.ValidationException.class,org.ehrbase.serialisation.exception.UnmarshalException.class}) public org.springframework.http.ResponseEntity<Object> handleBadRequestExceptions(Exception ex) -
handleObjectNotFoundException
@ExceptionHandler(org.springframework.security.access.AccessDeniedException.class) public org.springframework.http.ResponseEntity<Object> handleObjectNotFoundException(org.springframework.security.access.AccessDeniedException ex) -
handleObjectNotFoundException
@ExceptionHandler(org.ehrbase.api.exception.ObjectNotFoundException.class) public org.springframework.http.ResponseEntity<Object> handleObjectNotFoundException(ObjectNotFoundException ex) -
handleNotAcceptableException
@ExceptionHandler({org.springframework.web.HttpMediaTypeNotAcceptableException.class,org.ehrbase.api.exception.NotAcceptableException.class}) public org.springframework.http.ResponseEntity<Object> handleNotAcceptableException(NotAcceptableException ex) -
handleStateConflictException
@ExceptionHandler(org.ehrbase.api.exception.StateConflictException.class) public org.springframework.http.ResponseEntity<Object> handleStateConflictException(StateConflictException ex) -
handlePreconditionFailedException
@ExceptionHandler(org.ehrbase.api.exception.PreconditionFailedException.class) public org.springframework.http.ResponseEntity<Object> handlePreconditionFailedException(PreconditionFailedException ex) -
handleUnsupportedMediaTypeException
@ExceptionHandler({org.springframework.web.HttpMediaTypeNotSupportedException.class,org.ehrbase.api.exception.UnsupportedMediaTypeException.class}) public org.springframework.http.ResponseEntity<Object> handleUnsupportedMediaTypeException(UnsupportedMediaTypeException ex) -
handleUnprocessableEntityException
@ExceptionHandler(org.ehrbase.api.exception.UnprocessableEntityException.class) public org.springframework.http.ResponseEntity<Object> handleUnprocessableEntityException(UnprocessableEntityException ex, org.springframework.web.context.request.WebRequest request) -
handleSpringResponseStatusException
@ExceptionHandler(org.springframework.web.server.ResponseStatusException.class) public org.springframework.http.ResponseEntity<Object> handleSpringResponseStatusException(org.springframework.web.server.ResponseStatusException ex) -
handleUncaughtException
@ExceptionHandler(java.lang.Exception.class) public org.springframework.http.ResponseEntity<Object> handleUncaughtException(Exception ex)
-