The internalReceive method currently catches all exceptions, which can obscure the root cause of specific failures, such as invalid message types.
Insufficient Logging for Validation Failures:
When Preconditions.checkArgument fails (throwing an IllegalArgumentException), the existing implementation does not log detailed information about the failure. This limitation makes it challenging to diagnose issues related to message type mismatches.
Modifications
Enhanced Exception Handling: Added a specific catch block for IllegalArgumentException to log detailed information before rethrowing as a PulsarClientException.
Motivation
Generic Exception Handling:
internalReceive
method currently catches all exceptions, which can obscure the root cause of specific failures, such as invalid message types.Insufficient Logging for Validation Failures:
Preconditions.checkArgument
fails (throwing anIllegalArgumentException
), the existing implementation does not log detailed information about the failure. This limitation makes it challenging to diagnose issues related to message type mismatches.Modifications
catch
block forIllegalArgumentException
to log detailed information before rethrowing as aPulsarClientException
.Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete