Class CodecExceptionsHandler
java.lang.Object
com.cumulocity.microservice.lpwan.codec.handler.CodecExceptionsHandler
The CodecExceptionsHandler is a custom exception handler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<DecoderResult>This method handles the custom DecoderServiceException.org.springframework.http.ResponseEntity<EncoderResult>This method handles the custom EncoderServiceException.org.springframework.http.ResponseEntity<com.cumulocity.rest.representation.ErrorMessageRepresentation>handleIllegalArgumentException(Throwable exception) This method handles the IllegalArgumentException.
-
Constructor Details
-
CodecExceptionsHandler
public CodecExceptionsHandler()
-
-
Method Details
-
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_ERRORorHttpStatus.BAD_REQUESTorHttpStatus.NOT_IMPLEMENTED - See Also:
-
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_ERRORorHttpStatus.BAD_REQUESTorHttpStatus.NOT_IMPLEMENTED - See Also:
-
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:
-