You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/12/07 03:22:31 UTC

[pulsar] 05/05: fix exception cast error (#8828)

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

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

commit e0ef750315525f98a10933a5e920c2b39723e275
Author: Aloys <lo...@gmail.com>
AuthorDate: Sat Dec 5 01:31:46 2020 +0800

    fix exception cast error (#8828)
    
    Fixes #8827
    
    ### Motivation
    
    fix exception cast error
    
    (cherry picked from commit b1359a562baf63a2ebfc43cfc4b10f59a0720e86)
---
 .../src/main/java/org/apache/pulsar/broker/admin/AdminResource.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
index f5f955b..028c624 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
@@ -694,7 +694,7 @@ public abstract class AdminResource extends PulsarWebResource {
             return pulsar.getBrokerService().fetchPartitionedTopicMetadataAsync(topicName).get();
         } catch (Exception e) {
             if (e.getCause() instanceof RestException) {
-                throw (RestException) e;
+                throw (RestException) e.getCause();
             }
             throw new RestException(e);
         }
@@ -707,7 +707,7 @@ public abstract class AdminResource extends PulsarWebResource {
                     .get();
         } catch (Exception e) {
             if (e.getCause() instanceof RestException) {
-                throw (RestException) e;
+                throw (RestException) e.getCause();
             }
             throw new RestException(e);
         }