diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java index 385da9940a9ed..06f916d109038 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java @@ -322,22 +322,27 @@ public void handle(AsyncResult flushed) { new VertxClientInputStream(clientResponse, 100000, requestContext)); requestContext.resume(); } else { - clientResponse.bodyHandler(new Handler<>() { + clientResponse.body(new Handler<>() { @Override - public void handle(Buffer buffer) { - if (loggingScope != LoggingScope.NONE) { - clientLogger.logResponse(clientResponse, false); - } - try { - if (buffer.length() > 0) { - requestContext.setResponseEntityStream( - new ByteArrayInputStream(buffer.getBytes())); - } else { - requestContext.setResponseEntityStream(null); + public void handle(AsyncResult ar) { + if (ar.succeeded()) { + if (loggingScope != LoggingScope.NONE) { + clientLogger.logResponse(clientResponse, false); + } + Buffer buffer = ar.result(); + try { + if (buffer.length() > 0) { + requestContext.setResponseEntityStream( + new ByteArrayInputStream(buffer.getBytes())); + } else { + requestContext.setResponseEntityStream(null); + } + requestContext.resume(); + } catch (Throwable t) { + requestContext.resume(t); } - requestContext.resume(); - } catch (Throwable t) { - requestContext.resume(t); + } else { + requestContext.resume(ar.cause()); } } });