sijie commented on a change in pull request #5714: Add more info in the error
messages
URL: https://github.com/apache/pulsar/pull/5714#discussion_r352358429
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -1442,11 +1454,13 @@ public void seek(long timestamp) throws
PulsarClientException {
public CompletableFuture<Void> seekAsync(long timestamp) {
if (getState() == State.Closing || getState() == State.Closed) {
return FutureUtil
- .failedFuture(new
PulsarClientException.AlreadyClosedException("Consumer was already closed"));
+ .failedFuture(new PulsarClientException.AlreadyClosedException(
+ String.format("[%s][%s] Consumer was already closed",
topicName.toString(), subscription)));
}
if (!isConnected()) {
- return FutureUtil.failedFuture(new PulsarClientException("Not
connected to broker"));
+ return FutureUtil.failedFuture(new PulsarClientException(
+ String.format("[%s][%s] Not connected to broker",
topicName.toString(), subscription)));
Review comment:
This error message doesn't tell what action that this exception is about. It
only tells "client is not connected to a broker". It is not useful at all. You
should include the action in the error message.
"Client is not connected to broker when seeking subscription %s of topic %s
to timestamp %d".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services