diff --git a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java index 218c848fc3879b..417b801b198999 100644 --- a/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java +++ b/extensions/websockets-next/server/runtime/src/main/java/io/quarkus/websockets/next/runtime/WebSocketEndpointBase.java @@ -208,11 +208,18 @@ protected Uni sendText(String message, boolean broadcast) { } protected Uni multiText(Multi multi, boolean broadcast, Function> itemFun) { - multi.onFailure().call(connection::close).subscribe().with( - m -> { - itemFun.apply(m).subscribe().with(v -> LOG.debugf("Multi >> text message: %s", connection), - t -> LOG.errorf(t, "Unable to send text message from Multi: %s", connection)); - }); + multi.onFailure() + .call(connection::close) + .subscribe().with( + m -> { + itemFun.apply(m) + .subscribe() + .with(v -> LOG.debugf("Multi >> text message: %s", connection), + t -> LOG.errorf(t, "Unable to send text message from Multi: %s", connection)); + }, + t -> { + LOG.errorf(t, "Unable to send text message from Multi - connection was closed: %s ", connection); + }); return Uni.createFrom().voidItem(); } @@ -221,11 +228,18 @@ protected Uni sendBinary(Buffer message, boolean broadcast) { } protected Uni multiBinary(Multi multi, boolean broadcast, Function> itemFun) { - multi.onFailure().call(connection::close).subscribe().with( - m -> { - itemFun.apply(m).subscribe().with(v -> LOG.debugf("Multi >> binary message: %s", connection), - t -> LOG.errorf(t, "Unable to send binary message from Multi: %s", connection)); - }); + multi.onFailure() + .call(connection::close) + .subscribe().with( + m -> { + itemFun.apply(m) + .subscribe() + .with(v -> LOG.debugf("Multi >> binary message: %s", connection), + t -> LOG.errorf(t, "Unable to send binary message from Multi: %s", connection)); + }, + t -> { + LOG.errorf(t, "Unable to send text message from Multi - connection was closed: %s ", connection); + }); return Uni.createFrom().voidItem(); } }