From 63c515425edab0fe7a44d769f7c9e5627e49cb94 Mon Sep 17 00:00:00 2001 From: fengyubiao Date: Wed, 6 Nov 2024 09:37:21 +0800 Subject: [PATCH] [improve][admin] Print error log if handle http response fails (#23563) --- .../client/admin/internal/http/AsyncHttpConnector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java index de694534a9e25..b04c19b7ded45 100644 --- a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java +++ b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/http/AsyncHttpConnector.java @@ -272,7 +272,11 @@ public String getReasonPhrase() { if (response.hasResponseBody()) { jerseyResponse.setEntityStream(response.getResponseBodyAsStream()); } - callback.response(jerseyResponse); + try { + callback.response(jerseyResponse); + } catch (Exception ex) { + log.error("failed to handle the http response {}", jerseyResponse, ex); + } } })); return responseFuture;