diff options
Diffstat (limited to 'vespa-feed-client/src/main/java/ai/vespa/feed/client/ApacheCluster.java')
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/ApacheCluster.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/ApacheCluster.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/ApacheCluster.java index bf407c60075..6b6d7f82597 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/ApacheCluster.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/ApacheCluster.java @@ -18,12 +18,14 @@ import org.apache.hc.core5.util.Timeout; import javax.net.ssl.SSLContext; import java.io.IOException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.hc.core5.http.ssl.TlsCiphers.excludeH2Blacklisted; import static org.apache.hc.core5.http.ssl.TlsCiphers.excludeWeak; @@ -161,6 +163,12 @@ class ApacheCluster implements Cluster { return wrapped.getBodyBytes(); } + @Override + public String toString() { + return "HTTP response with code " + code() + + (body() != null ? " and body '" + new String(body(), UTF_8) + "'" : ""); + } + } } |