Class BasicExceptionHandler


  • @RestControllerAdvice
    public class BasicExceptionHandler
    extends Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleAccessDeniedException​(org.springframework.security.access.AccessDeniedException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleBadRequestDomainException​(com.rcore.domain.commons.exception.BadRequestDomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleDefaultException​(com.rcore.domain.commons.exception.DomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleForbiddenDomainException​(com.rcore.domain.commons.exception.ForbiddenDomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleInternalServerException​(com.rcore.domain.commons.exception.InternalServerDomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleTooManyRequestsDomainException​(com.rcore.domain.commons.exception.TooManyRequestsDomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnauthorizedDomainException​(com.rcore.domain.commons.exception.NotFoundDomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnauthorizedDomainException​(com.rcore.domain.commons.exception.UnauthorizedDomainException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUndeclaredException​(UndeclaredThrowableException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnknownException​(com.rcore.rest.api.commons.exception.HttpCommunicationException e, javax.servlet.http.HttpServletRequest request, Locale locale)  
      org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnknownException​(Exception e, javax.servlet.http.HttpServletRequest request, Locale locale)  
    • Constructor Detail

      • BasicExceptionHandler

        public BasicExceptionHandler()
    • Method Detail

      • handleUnauthorizedDomainException

        @ExceptionHandler(com.rcore.domain.commons.exception.UnauthorizedDomainException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnauthorizedDomainException​(com.rcore.domain.commons.exception.UnauthorizedDomainException e,
                                                                                                                                                                                            javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                            Locale locale)
      • handleTooManyRequestsDomainException

        @ExceptionHandler(com.rcore.domain.commons.exception.TooManyRequestsDomainException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleTooManyRequestsDomainException​(com.rcore.domain.commons.exception.TooManyRequestsDomainException e,
                                                                                                                                                                                               javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                               Locale locale)
      • handleUnauthorizedDomainException

        @ExceptionHandler(com.rcore.domain.commons.exception.NotFoundDomainException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnauthorizedDomainException​(com.rcore.domain.commons.exception.NotFoundDomainException e,
                                                                                                                                                                                            javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                            Locale locale)
      • handleBadRequestDomainException

        @ExceptionHandler(com.rcore.domain.commons.exception.BadRequestDomainException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleBadRequestDomainException​(com.rcore.domain.commons.exception.BadRequestDomainException e,
                                                                                                                                                                                          javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                          Locale locale)
      • handleForbiddenDomainException

        @ExceptionHandler(com.rcore.domain.commons.exception.ForbiddenDomainException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleForbiddenDomainException​(com.rcore.domain.commons.exception.ForbiddenDomainException e,
                                                                                                                                                                                         javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                         Locale locale)
      • handleUnknownException

        @ExceptionHandler(com.rcore.rest.api.commons.exception.HttpCommunicationException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnknownException​(com.rcore.rest.api.commons.exception.HttpCommunicationException e,
                                                                                                                                                                                 javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                 Locale locale)
      • handleAccessDeniedException

        @ExceptionHandler(org.springframework.security.access.AccessDeniedException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleAccessDeniedException​(org.springframework.security.access.AccessDeniedException e,
                                                                                                                                                                                      javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                      Locale locale)
      • handleInternalServerException

        @ExceptionHandler(com.rcore.domain.commons.exception.InternalServerDomainException.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleInternalServerException​(com.rcore.domain.commons.exception.InternalServerDomainException e,
                                                                                                                                                                                        javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                        Locale locale)
      • handleUnknownException

        @ExceptionHandler(java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleUnknownException​(Exception e,
                                                                                                                                                                                 javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                 Locale locale)
      • handleDefaultException

        @ExceptionHandler({com.rcore.domain.commons.exception.DefaultIncorrectValueException.class,com.rcore.domain.commons.exception.DefaultResourceNotFoundException.class,com.rcore.domain.commons.exception.DefaultValueIsNotUniqueException.class,com.rcore.domain.commons.exception.DefaultValueIsRequiredException.class})
        public org.springframework.http.ResponseEntity<io.foodtechlab.exceptionhandler.core.ErrorApiResponse<io.foodtechlab.exceptionhandler.core.Error>> handleDefaultException​(com.rcore.domain.commons.exception.DomainException e,
                                                                                                                                                                                 javax.servlet.http.HttpServletRequest request,
                                                                                                                                                                                 Locale locale)