You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/15 08:11:52 UTC

[GitHub] [pulsar] congbobo184 commented on a diff in pull request #18937: [fix][client] Fix the conversion from the response to string in client error handling

congbobo184 commented on code in PR #18937:
URL: https://github.com/apache/pulsar/pull/18937#discussion_r1049327432


##########
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/BaseResource.java:
##########
@@ -324,7 +324,7 @@ public static String getReasonFromServer(WebApplicationException e) {
         } catch (Exception ex) {
             try {
                 return ObjectMapperFactory.getThreadLocal().readValue(
-                        e.getResponse().getEntity().toString(), ErrorData.class).reason;
+                        e.getResponse().readEntity(String.class), ErrorData.class).reason;

Review Comment:
   Good catch! could you please add a test for it?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org