Class ApiMvcExceptionAdvisor

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
com.broadleafcommerce.common.error.validation.web.ApiMvcExceptionAdvisor
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.MessageSourceAware

@RestControllerAdvice(annotations=org.springframework.web.bind.annotation.ResponseBody.class) public class ApiMvcExceptionAdvisor extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
Provides default exception handling for a variety of Spring MVC Exceptions
Author:
Phillip Verheyden (phillipuniverse)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.core.env.Environment
     

    Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApiMvcExceptionAdvisor(org.springframework.core.env.Environment env)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.http.ResponseEntity<Object>
    handleExceptionInternal(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode statusCode, org.springframework.web.context.request.WebRequest request)
     
    protected void
    logDebug(Exception ex, org.springframework.web.context.request.WebRequest request)
     

    Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleErrorResponseException, handleException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • env

      protected org.springframework.core.env.Environment env
  • Constructor Details

    • ApiMvcExceptionAdvisor

      public ApiMvcExceptionAdvisor(org.springframework.core.env.Environment env)
  • Method Details

    • handleExceptionInternal

      protected org.springframework.http.ResponseEntity<Object> handleExceptionInternal(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode statusCode, org.springframework.web.context.request.WebRequest request)
      Overrides:
      handleExceptionInternal in class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
    • logDebug

      protected void logDebug(Exception ex, org.springframework.web.context.request.WebRequest request)