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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ApiError>
handleIllegalArgumentException
(IllegalArgumentException ex, org.springframework.web.context.request.WebRequest request) Handles uncaught illegal argument exceptions by logging them and returning anApiError
with 400 status.protected void
-
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 anApiError
with 400 status.- Parameters:
ex
- the exceptionrequest
- the web request- Returns:
- the api error
-
logDebug
-