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 TypeMethodDescriptionprotected ExceptionHandlerUtilsorg.springframework.http.ResponseEntity<ApiError>handleIllegalArgumentException(IllegalArgumentException ex, org.springframework.web.context.request.WebRequest request) Handles uncaught illegal argument exceptions by logging them and returning anApiErrorwith 400 status.protected voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetExceptionHandlerUtils(ExceptionHandlerUtils exceptionHandlerUtils)
-
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 anApiErrorwith 400 status.- Parameters:
ex- the exceptionrequest- the web request- Returns:
- the api error
-
logDebug
@Deprecated(forRemoval=true) protected void logDebug(Throwable ex, org.springframework.web.context.request.WebRequest request) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated in favor of central logging managed byExceptionHandlerUtils. -
getExceptionHandlerUtils
-
setExceptionHandlerUtils
-
ExceptionHandlerUtils.