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 Details

    • ExceptionHandlers

      public ExceptionHandlers()
  • Method Details

    • handleAuthenticationException

      @ExceptionHandler(AuthenticationException.class) @ResponseStatus(UNAUTHORIZED) public ResponseBody handleAuthenticationException(jakarta.servlet.http.HttpServletRequest request, AuthenticationException e)
    • handleActionDeniedException

      @ExceptionHandler(org.craftercms.commons.security.exception.ActionDeniedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleActionDeniedException(jakarta.servlet.http.HttpServletRequest request, org.craftercms.commons.security.exception.ActionDeniedException e)
    • handleActionsDeniedException

      @ExceptionHandler(ActionsDeniedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleActionsDeniedException(jakarta.servlet.http.HttpServletRequest request, ActionsDeniedException e)
    • handleUserAlreadyExistsException

      @ExceptionHandler(UserAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleUserAlreadyExistsException(jakarta.servlet.http.HttpServletRequest request, UserAlreadyExistsException e)
    • handleUserNotFoundException

      @ExceptionHandler(UserNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleUserNotFoundException(jakarta.servlet.http.HttpServletRequest request, UserNotFoundException e)
    • handleUserExternallyManagedException

      @ExceptionHandler(UserExternallyManagedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleUserExternallyManagedException(jakarta.servlet.http.HttpServletRequest request, UserExternallyManagedException e)
    • handleGroupExternallyManagedException

      @ExceptionHandler(GroupExternallyManagedException.class) @ResponseStatus(FORBIDDEN) public ResponseBody handleGroupExternallyManagedException(jakarta.servlet.http.HttpServletRequest request, GroupExternallyManagedException e)
    • handleNoSuchElementException

      @ExceptionHandler(java.util.NoSuchElementException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleNoSuchElementException(jakarta.servlet.http.HttpServletRequest request, NoSuchElementException e)
    • handleLoggerNotFoundException

      @ExceptionHandler(LoggerNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleLoggerNotFoundException(jakarta.servlet.http.HttpServletRequest request, LoggerNotFoundException e)
    • handleConfigurationProfileNotFoundException

      @ExceptionHandler(org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleConfigurationProfileNotFoundException(jakarta.servlet.http.HttpServletRequest request, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException e)
    • handleGroupAlreadyExistsException

      @ExceptionHandler(GroupAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleGroupAlreadyExistsException(jakarta.servlet.http.HttpServletRequest request, GroupAlreadyExistsException e)
    • handleInvalidParametersException

      @ExceptionHandler(InvalidParametersException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidParametersException(jakarta.servlet.http.HttpServletRequest request, InvalidParametersException e)
    • handleInvalidSiteStateException

      @ExceptionHandler(InvalidSiteStateException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidSiteStateException(jakarta.servlet.http.HttpServletRequest request, InvalidSiteStateException e)
    • handleMarketplaceNotInitializedException

      @ExceptionHandler(MarketplaceNotInitializedException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleMarketplaceNotInitializedException(jakarta.servlet.http.HttpServletRequest request, MarketplaceNotInitializedException e)
    • handleMarketplaceUnreachableException

      @ExceptionHandler(MarketplaceUnreachableException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleMarketplaceUnreachableException(jakarta.servlet.http.HttpServletRequest request, MarketplaceUnreachableException e)
    • handlePluginAlreadyInstalledException

      @ExceptionHandler(PluginAlreadyInstalledException.class) @ResponseStatus(CONFLICT) public ResponseBody handlePluginAlreadyInstalledException(jakarta.servlet.http.HttpServletRequest request, PluginAlreadyInstalledException e)
    • handleMissingPluginParameterException

      @ExceptionHandler(MissingPluginParameterException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleMissingPluginParameterException(jakarta.servlet.http.HttpServletRequest request, MissingPluginParameterException e)
    • handlePluginInstallationException

      @ExceptionHandler(PluginInstallationException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handlePluginInstallationException(jakarta.servlet.http.HttpServletRequest request, PluginInstallationException e)
    • handlePublishedRepositoryNotFoundException

      @ExceptionHandler(PublishedRepositoryNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handlePublishedRepositoryNotFoundException(jakarta.servlet.http.HttpServletRequest request, PublishedRepositoryNotFoundException e)
    • handleServiceException

      @ExceptionHandler(ServiceLayerException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleServiceException(jakarta.servlet.http.HttpServletRequest request, ServiceLayerException e)
    • handleCompositeException

      @ExceptionHandler(CompositeException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleCompositeException(jakarta.servlet.http.HttpServletRequest request, CompositeException compositeException)
    • handleOrganizationNotFoundException

      @ExceptionHandler(OrganizationNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleOrganizationNotFoundException(jakarta.servlet.http.HttpServletRequest request, OrganizationNotFoundException e)
    • handleGroupNotFoundException

      @ExceptionHandler(GroupNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleGroupNotFoundException(jakarta.servlet.http.HttpServletRequest request, GroupNotFoundException e)
    • handleJsonProcessingException

      @ResponseStatus(BAD_REQUEST) @ExceptionHandler(com.fasterxml.jackson.core.JsonProcessingException.class) public ResponseBody handleJsonProcessingException(jakarta.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(jakarta.servlet.http.HttpServletRequest request, com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException e)
    • handleSiteAlreadyExistsException

      @ExceptionHandler(SiteAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleSiteAlreadyExistsException(jakarta.servlet.http.HttpServletRequest request, SiteAlreadyExistsException e)
    • handleSiteNotFoundException

      @ExceptionHandler(SiteNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleSiteNotFoundException(jakarta.servlet.http.HttpServletRequest request, SiteNotFoundException e)
    • handleRemoteAlreadyExistsException

      @ExceptionHandler(RemoteAlreadyExistsException.class) @ResponseStatus(CONFLICT) public ResponseBody handleRemoteAlreadyExistsException(jakarta.servlet.http.HttpServletRequest request, RemoteAlreadyExistsException e)
    • handleInvalidRemoteUrlException

      @ExceptionHandler(InvalidRemoteUrlException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidRemoteUrlException(jakarta.servlet.http.HttpServletRequest request, InvalidRemoteUrlException e)
    • handlePasswordRequirementsFailedException

      @ExceptionHandler(PasswordRequirementsFailedException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handlePasswordRequirementsFailedException(jakarta.servlet.http.HttpServletRequest request, PasswordRequirementsFailedException e)
    • handleRequestRejectedException

      @ResponseStatus(BAD_REQUEST) @ExceptionHandler(org.springframework.security.web.firewall.RequestRejectedException.class) public ResponseBody handleRequestRejectedException(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.web.firewall.RequestRejectedException e)
    • handlePasswordDoesNotMatchException

      @ExceptionHandler(PasswordDoesNotMatchException.class) @ResponseStatus(UNAUTHORIZED) public ResponseBody handlePasswordDoesNotMatchException(jakarta.servlet.http.HttpServletRequest request, PasswordDoesNotMatchException e)
    • handlePullFromRemoteConflictException

      @ExceptionHandler(PullFromRemoteConflictException.class) @ResponseStatus(CONFLICT) public ResponseBody handlePullFromRemoteConflictException(jakarta.servlet.http.HttpServletRequest request, PullFromRemoteConflictException e)
    • handleContentNotFoundException

      @ExceptionHandler(ContentNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleContentNotFoundException(jakarta.servlet.http.HttpServletRequest request, ContentNotFoundException e)
    • handleBlobNotFoundException

      @ExceptionHandler(BlobNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleBlobNotFoundException(jakarta.servlet.http.HttpServletRequest request, BlobNotFoundException e)
    • handlePublishingPackageNotFoundException

      @ExceptionHandler(PublishingPackageNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handlePublishingPackageNotFoundException(jakarta.servlet.http.HttpServletRequest request, PublishingPackageNotFoundException e)
    • handleMissingServletRequestParameterException

      @ExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleMissingServletRequestParameterException(jakarta.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(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.bind.MethodArgumentNotValidException e)
    • handleConstraintValidationException

      @ResponseStatus(BAD_REQUEST) @ExceptionHandler(jakarta.validation.ConstraintViolationException.class) public ResultList<org.craftercms.core.controller.rest.ValidationFieldError> handleConstraintValidationException(jakarta.servlet.http.HttpServletRequest request, jakarta.validation.ConstraintViolationException e)
    • handleHttpMessageNotReadableException

      @ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleHttpMessageNotReadableException(jakarta.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(jakarta.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(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.method.annotation.MethodArgumentTypeMismatchException e)
    • handleInvalidManagementTokenException

      @ExceptionHandler(org.craftercms.commons.exceptions.InvalidManagementTokenException.class) @ResponseStatus(UNAUTHORIZED) public ResponseBody handleInvalidManagementTokenException(jakarta.servlet.http.HttpServletRequest request, org.craftercms.commons.exceptions.InvalidManagementTokenException e)
    • handleBeanPropertyBindingResult

      @ExceptionHandler(org.springframework.validation.BindException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleBeanPropertyBindingResult(jakarta.servlet.http.HttpServletRequest request, org.springframework.validation.BindException e)
    • handleRemoteNotRemovableException

      @ExceptionHandler(RemoteNotRemovableException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleRemoteNotRemovableException(jakarta.servlet.http.HttpServletRequest request, RemoteNotRemovableException e)
    • handleException

      @ExceptionHandler(org.craftercms.core.exception.PathNotFoundException.class) @ResponseStatus(NOT_FOUND) public ResponseBody handleException(jakarta.servlet.http.HttpServletRequest request, org.craftercms.core.exception.PathNotFoundException e)
    • handleInvalidConfigurationException

      @ExceptionHandler(InvalidConfigurationException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidConfigurationException(jakarta.servlet.http.HttpServletRequest request, InvalidConfigurationException e)
    • handleSitePolicyValidationException

      @ResponseStatus(BAD_REQUEST) @ExceptionHandler public ResponseBody handleSitePolicyValidationException(jakarta.servlet.http.HttpServletRequest request, ValidationException 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(jakarta.servlet.http.HttpServletRequest request, org.craftercms.commons.validation.ValidationResultAware e)
    • handleInvalidRemoteRepositoryCredentialsException

      @ExceptionHandler(InvalidRemoteRepositoryCredentialsException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleInvalidRemoteRepositoryCredentialsException(jakarta.servlet.http.HttpServletRequest request, InvalidRemoteRepositoryCredentialsException e)
    • handleRemoteRepositoryNotFoundException

      @ExceptionHandler(RemoteRepositoryNotFoundException.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleRemoteRepositoryNotFoundException(jakarta.servlet.http.HttpServletRequest request, RemoteRepositoryNotFoundException e)
    • handleException

      @ExceptionHandler(ContentLockedByAnotherUserException.class) @ResponseStatus(CONFLICT) public ResponseBody handleException(jakarta.servlet.http.HttpServletRequest request, ContentLockedByAnotherUserException e)
    • handleException

      @ExceptionHandler(ContentExistException.class) @ResponseStatus(CONFLICT) public ResponseBody handleException(jakarta.servlet.http.HttpServletRequest request, ContentExistException e)
    • handleException

      @ExceptionHandler(ContentMoveInvalidLocation.class) @ResponseStatus(BAD_REQUEST) public ResponseBody handleException(jakarta.servlet.http.HttpServletRequest request, ContentMoveInvalidLocation e)
    • handleException

      @ExceptionHandler(java.lang.Exception.class) @ResponseStatus(INTERNAL_SERVER_ERROR) public ResponseBody handleException(jakarta.servlet.http.HttpServletRequest request, Exception e)
    • handleExceptionInternal

      protected ResponseBody handleExceptionInternal(jakarta.servlet.http.HttpServletRequest request, Exception e, ApiResponse response)
    • handleExceptionInternal

      protected ResponseBody handleExceptionInternal(jakarta.servlet.http.HttpServletRequest request, Exception e, ApiResponse response, org.slf4j.event.Level logLevel)