You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2025/07/25 11:26:12 UTC

(pulsar) branch branch-3.3 updated: [fix] Prevent IllegalStateException: Field 'message' is not set (#24472)

This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 20ac5394a44 [fix] Prevent IllegalStateException: Field 'message' is not set (#24472)
20ac5394a44 is described below

commit 20ac5394a44398d2815b06bb2af43f5e533b0367
Author: Andrey Yegorov <86...@users.noreply.github.com>
AuthorDate: Wed Jul 2 08:57:02 2025 -0700

    [fix] Prevent IllegalStateException: Field 'message' is not set (#24472)
    
    (cherry picked from commit 45da98d0137d1b16ef6aab30fc8f2b7c5a7380e3)
---
 .../src/main/java/org/apache/pulsar/client/impl/ClientCnx.java      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
index 33cc392ce38..ffba7fab31d 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
@@ -648,10 +648,12 @@ public class ClientCnx extends PulsarHandler {
             if (!lookupResult.hasResponse()
                     || CommandLookupTopicResponse.LookupType.Failed.equals(lookupResult.getResponse())) {
                 if (lookupResult.hasError()) {
-                    checkServerError(lookupResult.getError(), lookupResult.getMessage());
+                    checkServerError(lookupResult.getError(),
+                            lookupResult.hasMessage() ? lookupResult.getMessage() : lookupResult.getError().name());
                     requestFuture.completeExceptionally(
                             getPulsarClientException(lookupResult.getError(),
-                                    buildError(lookupResult.getRequestId(), lookupResult.getMessage())));
+                                    buildError(lookupResult.getRequestId(),
+                                            lookupResult.hasMessage() ? lookupResult.getMessage() : null)));
                 } else {
                     requestFuture
                             .completeExceptionally(new PulsarClientException.LookupException("Empty lookup response"));