Class ExceptionHandlers
- java.lang.Object
-
- org.craftercms.studio.controller.rest.v2.ExceptionHandlers
-
@Order(-2147483648) @RestControllerAdvice({"org.craftercms.studio.controller.rest.v2","org.craftercms.studio.controller.web.v1"}) public class ExceptionHandlers extends Object
Controller advice that handles exceptions thrown by API 2 REST controllers.- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description ExceptionHandlers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseBody
handleActionDeniedException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.security.exception.ActionDeniedException e)
ResponseBody
handleActionsDeniedException(javax.servlet.http.HttpServletRequest request, ActionsDeniedException e)
ResponseBody
handleAuthenticationException(javax.servlet.http.HttpServletRequest request, AuthenticationException e)
ResponseBody
handleBeanPropertyBindingResult(javax.servlet.http.HttpServletRequest request, org.springframework.validation.BindException e)
ResponseBody
handleBlobNotFoundException(javax.servlet.http.HttpServletRequest request, BlobNotFoundException e)
ResponseBody
handleConfigurationProfileNotFoundException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException e)
ResultList<org.craftercms.core.controller.rest.ValidationFieldError>
handleConstraintValidationException(javax.servlet.http.HttpServletRequest request, javax.validation.ConstraintViolationException e)
ResponseBody
handleContentNotFoundException(javax.servlet.http.HttpServletRequest request, ContentNotFoundException e)
ResponseBody
handleException(javax.servlet.http.HttpServletRequest request, Exception e)
ResponseBody
handleException(javax.servlet.http.HttpServletRequest request, org.craftercms.core.exception.PathNotFoundException e)
ResponseBody
handleException(javax.servlet.http.HttpServletRequest request, ContentAlreadyUnlockedException e)
ResponseBody
handleException(javax.servlet.http.HttpServletRequest request, ContentExistException e)
ResponseBody
handleException(javax.servlet.http.HttpServletRequest request, ContentLockedByAnotherUserException e)
ResponseBody
handleException(javax.servlet.http.HttpServletRequest request, ContentMoveInvalidLocation e)
protected ResponseBody
handleExceptionInternal(javax.servlet.http.HttpServletRequest request, Exception e, ApiResponse response)
protected ResponseBody
handleExceptionInternal(javax.servlet.http.HttpServletRequest request, Exception e, ApiResponse response, org.slf4j.event.Level logLevel)
ResponseBody
handleGroupAlreadyExistsException(javax.servlet.http.HttpServletRequest request, GroupAlreadyExistsException e)
ResponseBody
handleGroupExternallyManagedException(javax.servlet.http.HttpServletRequest request, GroupExternallyManagedException e)
ResponseBody
handleGroupNotFoundException(javax.servlet.http.HttpServletRequest request, GroupNotFoundException e)
ResponseBody
handleHttpMessageNotReadableException(javax.servlet.http.HttpServletRequest request, org.springframework.http.converter.HttpMessageNotReadableException e)
ResponseBody
handleInvalidConfigurationException(javax.servlet.http.HttpServletRequest request, InvalidConfigurationException e)
ResponseBody
handleInvalidManagementTokenException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.exceptions.InvalidManagementTokenException e)
ResponseBody
handleInvalidParametersException(javax.servlet.http.HttpServletRequest request, InvalidParametersException e)
ResponseBody
handleInvalidRemoteRepositoryCredentialsException(javax.servlet.http.HttpServletRequest request, InvalidRemoteRepositoryCredentialsException e)
ResponseBody
handleInvalidRemoteUrlException(javax.servlet.http.HttpServletRequest request, InvalidRemoteUrlException e)
ResponseBody
handleJsonProcessingException(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.core.JsonProcessingException e)
ResponseBody
handleLoggerNotFoundException(javax.servlet.http.HttpServletRequest request, LoggerNotFoundException e)
ResponseBody
handleMarketplaceNotInitializedException(javax.servlet.http.HttpServletRequest request, MarketplaceNotInitializedException e)
ResponseBody
handleMarketplaceUnreachableException(javax.servlet.http.HttpServletRequest request, MarketplaceUnreachableException e)
ResultList<org.craftercms.core.controller.rest.ValidationFieldError>
handleMethodArgumentNotValidException(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.MethodArgumentNotValidException e)
ResultList<org.craftercms.core.controller.rest.ValidationFieldError>
handleMethodArgumentTypeMismatchException(javax.servlet.http.HttpServletRequest request, org.springframework.web.method.annotation.MethodArgumentTypeMismatchException e)
ResponseBody
handleMismatchInputException(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.exc.MismatchedInputException e)
ResponseBody
handleMissingPluginParameterException(javax.servlet.http.HttpServletRequest request, MissingPluginParameterException e)
ResponseBody
handleMissingServletRequestParameterException(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.MissingServletRequestParameterException e)
ResponseBody
handleNoSuchElementException(javax.servlet.http.HttpServletRequest request, NoSuchElementException e)
ResponseBody
handleOrganizationNotFoundException(javax.servlet.http.HttpServletRequest request, OrganizationNotFoundException e)
ResponseBody
handlePasswordDoesNotMatchException(javax.servlet.http.HttpServletRequest request, PasswordDoesNotMatchException e)
ResponseBody
handlePasswordRequirementsFailedException(javax.servlet.http.HttpServletRequest request, PasswordRequirementsFailedException e)
ResponseBody
handlePluginAlreadyInstalledException(javax.servlet.http.HttpServletRequest request, PluginAlreadyInstalledException e)
ResponseBody
handlePluginInstallationException(javax.servlet.http.HttpServletRequest request, PluginInstallationException e)
ResponseBody
handlePublishedRepositoryNotFoundException(javax.servlet.http.HttpServletRequest request, PublishedRepositoryNotFoundException e)
ResponseBody
handlePublishingPackageNotFoundException(javax.servlet.http.HttpServletRequest request, PublishingPackageNotFoundException e)
ResponseBody
handlePullFromRemoteConflictException(javax.servlet.http.HttpServletRequest request, PullFromRemoteConflictException e)
ResponseBody
handleRemoteAlreadyExistsException(javax.servlet.http.HttpServletRequest request, RemoteAlreadyExistsException e)
ResponseBody
handleRemoteNotRemovableException(javax.servlet.http.HttpServletRequest request, RemoteNotRemovableException e)
ResponseBody
handleRemoteRepositoryNotFoundException(javax.servlet.http.HttpServletRequest request, RemoteRepositoryNotFoundException e)
ResponseBody
handleRequestRejectedException(javax.servlet.http.HttpServletRequest request, org.springframework.security.web.firewall.RequestRejectedException e)
ResponseBody
handleServiceException(javax.servlet.http.HttpServletRequest request, ServiceLayerException e)
ResponseBody
handleSiteAlreadyExistsException(javax.servlet.http.HttpServletRequest request, SiteAlreadyExistsException e)
ResponseBody
handleSiteNotFoundException(javax.servlet.http.HttpServletRequest request, SiteNotFoundException e)
ResponseBody
handleUnrecognizedPropertyException(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException e)
ResponseBody
handleUserAlreadyExistsException(javax.servlet.http.HttpServletRequest request, UserAlreadyExistsException e)
ResponseBody
handleUserExternallyManagedException(javax.servlet.http.HttpServletRequest request, UserExternallyManagedException e)
ResponseBody
handleUserNotFoundException(javax.servlet.http.HttpServletRequest request, UserNotFoundException e)
ResultList<org.craftercms.core.controller.rest.ValidationFieldError>
handleValidationRuntimeException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationResultAware e)
-
-
-
Method Detail
-
handleAuthenticationException
@ExceptionHandler(AuthenticationException.class) @ResponseStatus(UNAUTHORIZED) public ResponseBody handleAuthenticationException(javax.servlet.http.HttpServletRequest request, AuthenticationException e)
-
handleActionDeniedException
@ExceptionHandler(org.craftercms.commons.security.exception.ActionDeniedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleActionDeniedException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.security.exception.ActionDeniedException e)
-
handleActionsDeniedException
@ExceptionHandler(ActionsDeniedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleActionsDeniedException(javax.servlet.http.HttpServletRequest request, ActionsDeniedException e)
-
handleUserAlreadyExistsException
@ExceptionHandler(UserAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleUserAlreadyExistsException(javax.servlet.http.HttpServletRequest request, UserAlreadyExistsException e)
-
handleUserNotFoundException
@ExceptionHandler(UserNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleUserNotFoundException(javax.servlet.http.HttpServletRequest request, UserNotFoundException e)
-
handleUserExternallyManagedException
@ExceptionHandler(UserExternallyManagedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleUserExternallyManagedException(javax.servlet.http.HttpServletRequest request, UserExternallyManagedException e)
-
handleGroupExternallyManagedException
@ExceptionHandler(GroupExternallyManagedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleGroupExternallyManagedException(javax.servlet.http.HttpServletRequest request, GroupExternallyManagedException e)
-
handleNoSuchElementException
@ExceptionHandler(java.util.NoSuchElementException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleNoSuchElementException(javax.servlet.http.HttpServletRequest request, NoSuchElementException e)
-
handleLoggerNotFoundException
@ExceptionHandler(LoggerNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleLoggerNotFoundException(javax.servlet.http.HttpServletRequest request, LoggerNotFoundException e)
-
handleConfigurationProfileNotFoundException
@ExceptionHandler(org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleConfigurationProfileNotFoundException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException e)
-
handleGroupAlreadyExistsException
@ExceptionHandler(GroupAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleGroupAlreadyExistsException(javax.servlet.http.HttpServletRequest request, GroupAlreadyExistsException e)
-
handleInvalidParametersException
@ExceptionHandler(InvalidParametersException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidParametersException(javax.servlet.http.HttpServletRequest request, InvalidParametersException e)
-
handleMarketplaceNotInitializedException
@ExceptionHandler(MarketplaceNotInitializedException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleMarketplaceNotInitializedException(javax.servlet.http.HttpServletRequest request, MarketplaceNotInitializedException e)
-
handleMarketplaceUnreachableException
@ExceptionHandler(MarketplaceUnreachableException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleMarketplaceUnreachableException(javax.servlet.http.HttpServletRequest request, MarketplaceUnreachableException e)
-
handlePluginAlreadyInstalledException
@ExceptionHandler(PluginAlreadyInstalledException.class) @ResponseStatus(CONFLICT) public ResponseBody handlePluginAlreadyInstalledException(javax.servlet.http.HttpServletRequest request, PluginAlreadyInstalledException e)
-
handleMissingPluginParameterException
@ExceptionHandler(MissingPluginParameterException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleMissingPluginParameterException(javax.servlet.http.HttpServletRequest request, MissingPluginParameterException e)
-
handlePluginInstallationException
@ExceptionHandler(PluginInstallationException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handlePluginInstallationException(javax.servlet.http.HttpServletRequest request, PluginInstallationException e)
-
handlePublishedRepositoryNotFoundException
@ExceptionHandler(PublishedRepositoryNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handlePublishedRepositoryNotFoundException(javax.servlet.http.HttpServletRequest request, PublishedRepositoryNotFoundException e)
-
handleServiceException
@ExceptionHandler(ServiceLayerException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleServiceException(javax.servlet.http.HttpServletRequest request, ServiceLayerException e)
-
handleOrganizationNotFoundException
@ExceptionHandler(OrganizationNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleOrganizationNotFoundException(javax.servlet.http.HttpServletRequest request, OrganizationNotFoundException e)
-
handleGroupNotFoundException
@ExceptionHandler(GroupNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleGroupNotFoundException(javax.servlet.http.HttpServletRequest request, GroupNotFoundException e)
-
handleJsonProcessingException
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(com.fasterxml.jackson.core.JsonProcessingException.class) public ResponseBody handleJsonProcessingException(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.core.JsonProcessingException e)
-
handleUnrecognizedPropertyException
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.class) public ResponseBody handleUnrecognizedPropertyException(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException e)
-
handleSiteAlreadyExistsException
@ExceptionHandler(SiteAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleSiteAlreadyExistsException(javax.servlet.http.HttpServletRequest request, SiteAlreadyExistsException e)
-
handleSiteNotFoundException
@ExceptionHandler(SiteNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleSiteNotFoundException(javax.servlet.http.HttpServletRequest request, SiteNotFoundException e)
-
handleRemoteAlreadyExistsException
@ExceptionHandler(RemoteAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleRemoteAlreadyExistsException(javax.servlet.http.HttpServletRequest request, RemoteAlreadyExistsException e)
-
handleInvalidRemoteUrlException
@ExceptionHandler(InvalidRemoteUrlException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidRemoteUrlException(javax.servlet.http.HttpServletRequest request, InvalidRemoteUrlException e)
-
handlePasswordRequirementsFailedException
@ExceptionHandler(PasswordRequirementsFailedException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handlePasswordRequirementsFailedException(javax.servlet.http.HttpServletRequest request, PasswordRequirementsFailedException e)
-
handleRequestRejectedException
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(org.springframework.security.web.firewall.RequestRejectedException.class) public ResponseBody handleRequestRejectedException(javax.servlet.http.HttpServletRequest request, org.springframework.security.web.firewall.RequestRejectedException e)
-
handlePasswordDoesNotMatchException
@ExceptionHandler(PasswordDoesNotMatchException.class) @ResponseStatus(UNAUTHORIZED) public ResponseBody handlePasswordDoesNotMatchException(javax.servlet.http.HttpServletRequest request, PasswordDoesNotMatchException e)
-
handlePullFromRemoteConflictException
@ExceptionHandler(PullFromRemoteConflictException.class) @ResponseStatus(CONFLICT) public ResponseBody handlePullFromRemoteConflictException(javax.servlet.http.HttpServletRequest request, PullFromRemoteConflictException e)
-
handleContentNotFoundException
@ExceptionHandler(ContentNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleContentNotFoundException(javax.servlet.http.HttpServletRequest request, ContentNotFoundException e)
-
handleBlobNotFoundException
@ExceptionHandler(BlobNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleBlobNotFoundException(javax.servlet.http.HttpServletRequest request, BlobNotFoundException e)
-
handlePublishingPackageNotFoundException
@ExceptionHandler(PublishingPackageNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handlePublishingPackageNotFoundException(javax.servlet.http.HttpServletRequest request, PublishingPackageNotFoundException e)
-
handleMissingServletRequestParameterException
@ExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleMissingServletRequestParameterException(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.MissingServletRequestParameterException e)
-
handleMethodArgumentNotValidException
@ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class) @ResponseStatus(BAD_REQUEST) public ResultList<org.craftercms.core.controller.rest.ValidationFieldError> handleMethodArgumentNotValidException(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.MethodArgumentNotValidException e)
-
handleConstraintValidationException
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(javax.validation.ConstraintViolationException.class) public ResultList<org.craftercms.core.controller.rest.ValidationFieldError> handleConstraintValidationException(javax.servlet.http.HttpServletRequest request, javax.validation.ConstraintViolationException e)
-
handleHttpMessageNotReadableException
@ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleHttpMessageNotReadableException(javax.servlet.http.HttpServletRequest request, org.springframework.http.converter.HttpMessageNotReadableException e)
-
handleMismatchInputException
@ResponseStatus(BAD_REQUEST) @ExceptionHandler(com.fasterxml.jackson.databind.exc.MismatchedInputException.class) public ResponseBody handleMismatchInputException(javax.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.exc.MismatchedInputException e)
-
handleMethodArgumentTypeMismatchException
@ExceptionHandler(org.springframework.web.method.annotation.MethodArgumentTypeMismatchException.class) @ResponseStatus(BAD_REQUEST) public ResultList<org.craftercms.core.controller.rest.ValidationFieldError> handleMethodArgumentTypeMismatchException(javax.servlet.http.HttpServletRequest request, org.springframework.web.method.annotation.MethodArgumentTypeMismatchException e)
-
handleInvalidManagementTokenException
@ExceptionHandler(org.craftercms.commons.exceptions.InvalidManagementTokenException.class) @ResponseStatus(UNAUTHORIZED) public ResponseBody handleInvalidManagementTokenException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.exceptions.InvalidManagementTokenException e)
-
handleBeanPropertyBindingResult
@ExceptionHandler(org.springframework.validation.BindException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleBeanPropertyBindingResult(javax.servlet.http.HttpServletRequest request, org.springframework.validation.BindException e)
-
handleRemoteNotRemovableException
@ExceptionHandler(RemoteNotRemovableException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleRemoteNotRemovableException(javax.servlet.http.HttpServletRequest request, RemoteNotRemovableException e)
-
handleException
@ExceptionHandler(org.craftercms.core.exception.PathNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleException(javax.servlet.http.HttpServletRequest request, org.craftercms.core.exception.PathNotFoundException e)
-
handleInvalidConfigurationException
@ExceptionHandler(InvalidConfigurationException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidConfigurationException(javax.servlet.http.HttpServletRequest request, InvalidConfigurationException e)
-
handleValidationRuntimeException
@ExceptionHandler({org.craftercms.commons.validation.ValidationRuntimeException.class,org.craftercms.commons.validation.ValidationException.class}) @ResponseStatus(BAD_REQUEST) public ResultList<org.craftercms.core.controller.rest.ValidationFieldError> handleValidationRuntimeException(javax.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationResultAware e)
-
handleInvalidRemoteRepositoryCredentialsException
@ExceptionHandler(InvalidRemoteRepositoryCredentialsException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidRemoteRepositoryCredentialsException(javax.servlet.http.HttpServletRequest request, InvalidRemoteRepositoryCredentialsException e)
-
handleRemoteRepositoryNotFoundException
@ExceptionHandler(RemoteRepositoryNotFoundException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleRemoteRepositoryNotFoundException(javax.servlet.http.HttpServletRequest request, RemoteRepositoryNotFoundException e)
-
handleException
@ExceptionHandler(ContentLockedByAnotherUserException.class) @ResponseStatus(CONFLICT) public ResponseBody handleException(javax.servlet.http.HttpServletRequest request, ContentLockedByAnotherUserException e)
-
handleException
@ExceptionHandler(ContentAlreadyUnlockedException.class) @ResponseStatus(CONFLICT) public ResponseBody handleException(javax.servlet.http.HttpServletRequest request, ContentAlreadyUnlockedException e)
-
handleException
@ExceptionHandler(ContentExistException.class) @ResponseStatus(CONFLICT) public ResponseBody handleException(javax.servlet.http.HttpServletRequest request, ContentExistException e)
-
handleException
@ExceptionHandler(ContentMoveInvalidLocation.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleException(javax.servlet.http.HttpServletRequest request, ContentMoveInvalidLocation e)
-
handleException
@ExceptionHandler(java.lang.Exception.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleException(javax.servlet.http.HttpServletRequest request, Exception e)
-
handleExceptionInternal
protected ResponseBody handleExceptionInternal(javax.servlet.http.HttpServletRequest request, Exception e, ApiResponse response)
-
handleExceptionInternal
protected ResponseBody handleExceptionInternal(javax.servlet.http.HttpServletRequest request, Exception e, ApiResponse response, org.slf4j.event.Level logLevel)
-
-