Class ExceptionHandlers
- java.lang.Object
-
- org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
- org.craftercms.commons.rest.BaseRestExceptionHandlers
-
- org.craftercms.commons.validation.rest.ValidationAwareRestExceptionHandlers
-
- org.craftercms.deployer.impl.rest.ExceptionHandlers
-
@Order(-2147483648) @ControllerAdvice public class ExceptionHandlers extends org.craftercms.commons.validation.rest.ValidationAwareRestExceptionHandlers
Extension ofBaseRestExceptionHandlers
that provides exception handlers for specific Crafter Deployer exceptions.- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description ExceptionHandlers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<Object>
handleInvalidManagementTokenException(org.craftercms.commons.exceptions.InvalidManagementTokenException ex, org.springframework.web.context.request.WebRequest request)
org.springframework.http.ResponseEntity<Object>
handleTargetAlreadyExistsException(TargetAlreadyExistsException ex, org.springframework.web.context.request.WebRequest request)
Handles aTargetAlreadyExistsException
by returning a 409 CONFLICT.org.springframework.http.ResponseEntity<Object>
handleTargetNotFoundException(TargetNotFoundException ex, org.springframework.web.context.request.WebRequest request)
Handles aTargetNotFoundException
by returning a 404 NOT FOUND.org.springframework.http.ResponseEntity<Object>
handleUnsupportedSearchEngineException(UnsupportedSearchEngineException ex, org.springframework.web.context.request.WebRequest request)
Handles aUnsupportedSearchEngineException
by returning a 400 BAD REQUEST.-
Methods inherited from class org.craftercms.commons.validation.rest.ValidationAwareRestExceptionHandlers
handleGeneralException, handleHttpMessageNotReadable, handleMethodArgumentNotValid, handleValidationException, setErrorMessageBundle
-
Methods inherited from class org.craftercms.commons.rest.BaseRestExceptionHandlers
handleExceptionInternal, handleExceptionInternal
-
Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch
-
-
-
-
Method Detail
-
handleTargetNotFoundException
@ExceptionHandler(TargetNotFoundException.class) public org.springframework.http.ResponseEntity<Object> handleTargetNotFoundException(TargetNotFoundException ex, org.springframework.web.context.request.WebRequest request)
Handles aTargetNotFoundException
by returning a 404 NOT FOUND.- Parameters:
ex
- the exceptionrequest
- the current request- Returns:
- the response entity, with the body and status
-
handleTargetAlreadyExistsException
@ExceptionHandler(TargetAlreadyExistsException.class) public org.springframework.http.ResponseEntity<Object> handleTargetAlreadyExistsException(TargetAlreadyExistsException ex, org.springframework.web.context.request.WebRequest request)
Handles aTargetAlreadyExistsException
by returning a 409 CONFLICT.- Parameters:
ex
- the exceptionrequest
- the current request- Returns:
- the response entity, with the body and status
-
handleUnsupportedSearchEngineException
@ExceptionHandler(UnsupportedSearchEngineException.class) public org.springframework.http.ResponseEntity<Object> handleUnsupportedSearchEngineException(UnsupportedSearchEngineException ex, org.springframework.web.context.request.WebRequest request)
Handles aUnsupportedSearchEngineException
by returning a 400 BAD REQUEST.- Parameters:
ex
- the exceptionrequest
- the current request- Returns:
- the response entity, with the body and status
-
handleInvalidManagementTokenException
@ExceptionHandler(org.craftercms.commons.exceptions.InvalidManagementTokenException.class) public org.springframework.http.ResponseEntity<Object> handleInvalidManagementTokenException(org.craftercms.commons.exceptions.InvalidManagementTokenException ex, org.springframework.web.context.request.WebRequest request)
-
-