Class CodecExceptionsHandler


  • @ControllerAdvice
    public class CodecExceptionsHandler
    extends Object
    The CodecExceptionsHandler is a custom exception handler.
    • Constructor Detail

      • CodecExceptionsHandler

        public CodecExceptionsHandler()
    • Method Detail

      • handleDecoderServiceException

        @ExceptionHandler(DecoderServiceException.class)
        @ResponseBody
        public org.springframework.http.ResponseEntity<DecoderResult> handleDecoderServiceException​(DecoderServiceException exception)
        This method handles the custom DecoderServiceException.
        Parameters:
        exception - represents the exception
        Returns:
        ResponseEntity HttpStatus.INTERNAL_SERVER_ERROR or HttpStatus.BAD_REQUEST or HttpStatus.NOT_IMPLEMENTED
        See Also:
        DecoderServiceException
      • handleEncoderServiceException

        @ExceptionHandler(EncoderServiceException.class)
        @ResponseBody
        public org.springframework.http.ResponseEntity<EncoderResult> handleEncoderServiceException​(EncoderServiceException exception)
        This method handles the custom EncoderServiceException.
        Parameters:
        exception - represents the exception
        Returns:
        ResponseEntity HttpStatus.INTERNAL_SERVER_ERROR or HttpStatus.BAD_REQUEST or HttpStatus.NOT_IMPLEMENTED
        See Also:
        EncoderServiceException
      • handleIllegalArgumentException

        @ExceptionHandler(java.lang.IllegalArgumentException.class)
        @ResponseBody
        public org.springframework.http.ResponseEntity<com.cumulocity.rest.representation.ErrorMessageRepresentation> handleIllegalArgumentException​(Throwable exception)
        This method handles the IllegalArgumentException.
        Parameters:
        exception - represents the exception
        Returns:
        ResponseEntity HttpStatus.BAD_REQUEST
        See Also:
        IllegalArgumentException