Class CodecExceptionsHandler
- java.lang.Object
-
- com.cumulocity.microservice.lpwan.codec.handler.CodecExceptionsHandler
-
@ControllerAdvice public class CodecExceptionsHandler extends Object
The CodecExceptionsHandler is a custom exception handler.
-
-
Constructor Summary
Constructors Constructor Description CodecExceptionsHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<DecoderResult>
handleDecoderServiceException(DecoderServiceException exception)
This method handles the custom DecoderServiceException.org.springframework.http.ResponseEntity<EncoderResult>
handleEncoderServiceException(EncoderServiceException exception)
This method handles the custom EncoderServiceException.org.springframework.http.ResponseEntity<com.cumulocity.rest.representation.ErrorMessageRepresentation>
handleIllegalArgumentException(Throwable exception)
This method handles the IllegalArgumentException.
-
-
-
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
orHttpStatus.BAD_REQUEST
orHttpStatus.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
orHttpStatus.BAD_REQUEST
orHttpStatus.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
-
-