Class IllegalArgumentExceptionAdvisor

java.lang.Object
com.broadleafcommerce.common.error.validation.web.IllegalArgumentExceptionAdvisor

@RestControllerAdvice(annotations=org.springframework.web.bind.annotation.ResponseBody.class) public class IllegalArgumentExceptionAdvisor extends Object
Exception advisor with a handler that handles uncaught illegal argument exceptions by logging them and returning an error response.
Author:
Nick Crum (ncrum)
  • Constructor Details

    • IllegalArgumentExceptionAdvisor

      public IllegalArgumentExceptionAdvisor()
  • Method Details

    • handleIllegalArgumentException

      @ExceptionHandler(java.lang.IllegalArgumentException.class) public org.springframework.http.ResponseEntity<ApiError> handleIllegalArgumentException(IllegalArgumentException ex, org.springframework.web.context.request.WebRequest request)
      Handles uncaught illegal argument exceptions by logging them and returning an ApiError with 400 status.
      Parameters:
      ex - the exception
      request - the web request
      Returns:
      the api error
    • logDebug

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