Skip to content

Commit 55fd45a

Browse files
committed
fixed exception handling on sending HTTP requests
1 parent 0d9df16 commit 55fd45a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

http/src/main/java/com/arangodb/http/HttpConnection.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,14 @@ public void doExecute(final InternalRequest request, final CompletableFuture<Int
253253
buffer = Buffer.buffer();
254254
}
255255

256-
httpRequest.sendBuffer(buffer)
257-
.map(this::buildResponse)
258-
.onSuccess(rfuture::complete)
259-
.onFailure(rfuture::completeExceptionally);
256+
try {
257+
httpRequest.sendBuffer(buffer)
258+
.map(this::buildResponse)
259+
.onSuccess(rfuture::complete)
260+
.onFailure(rfuture::completeExceptionally);
261+
} catch (Exception e) {
262+
rfuture.completeExceptionally(e);
263+
}
260264
}
261265

262266
private InternalResponse buildResponse(final HttpResponse<Buffer> httpResponse) {

0 commit comments

Comments
 (0)