Skip to content

Commit 2172b99

Browse files
committed
Polishing contribution
Closes gh-28836
1 parent b6144e5 commit 2172b99

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/AbstractListenerWebSocketSession.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@
3333
import org.springframework.http.server.reactive.AbstractListenerWriteProcessor;
3434
import org.springframework.lang.Nullable;
3535
import org.springframework.util.Assert;
36-
import org.springframework.util.StringUtils;
3736
import org.springframework.web.reactive.socket.CloseStatus;
3837
import org.springframework.web.reactive.socket.HandshakeInfo;
3938
import org.springframework.web.reactive.socket.WebSocketHandler;
@@ -248,12 +247,13 @@ public void onError(Throwable ex) {
248247
if (this.handlerCompletionMono != null) {
249248
this.handlerCompletionMono.onError(ex);
250249
}
251-
if(!StringUtils.hasText(ex.getMessage())) {
252-
close(CloseStatus.SERVER_ERROR);
250+
if (logger.isDebugEnabled()) {
251+
logger.debug("WebSocket session completed with error", ex);
253252
}
254-
else {
255-
close(CloseStatus.SERVER_ERROR.withReason(ex.getMessage()));
253+
else if (logger.isInfoEnabled()) {
254+
logger.info("WebSocket session completed with error: " + ex.getMessage());
256255
}
256+
close(CloseStatus.SERVER_ERROR);
257257
}
258258

259259
@Override

0 commit comments

Comments
 (0)