Class ExceptionAdvice


  • @ControllerAdvice
    public class ExceptionAdvice
    extends Object
    • Constructor Detail

      • ExceptionAdvice

        public ExceptionAdvice()
    • Method Detail

      • handleResourceNotFoundException

        @ResponseStatus(NOT_FOUND)
        @ExceptionHandler(de.digitalcollections.model.exception.ResourceNotFoundException.class)
        public void handleResourceNotFoundException​(Exception exception)
      • handleScalingException

        @ExceptionHandler(ScalingException.class)
        @ResponseStatus(BAD_REQUEST)
        @ResponseBody
        protected ApiError handleScalingException​(ScalingException exception)
        Sometimes scaling an image can lead to broken dimensions (usually because of rounding to 0).
        Parameters:
        exception - The exception to handle
        Returns:
        An error description for the client