diff --git a/spring-web/src/main/java/org/springframework/web/util/DisconnectedClientHelper.java b/spring-web/src/main/java/org/springframework/web/util/DisconnectedClientHelper.java index 2f443b133a..4ba3441a47 100644 --- a/spring-web/src/main/java/org/springframework/web/util/DisconnectedClientHelper.java +++ b/spring-web/src/main/java/org/springframework/web/util/DisconnectedClientHelper.java @@ -39,8 +39,7 @@ public class DisconnectedClientHelper { Set.of("broken pipe", "connection reset by peer"); private static final Set EXCEPTION_TYPE_NAMES = - Set.of("ClientAbortException", "EOFException", "EofException"); - + Set.of("AbortedException", "ClientAbortException", "EOFException", "EofException"); private final Log logger; @@ -51,28 +50,6 @@ public class DisconnectedClientHelper { } - /** - * Whether the given exception indicates the client has gone away. - * Known cases covered: - * - */ - public boolean isClientDisconnectedException(Throwable ex) { - String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage(); - if (message != null) { - String text = message.toLowerCase(); - for (String phrase : EXCEPTION_PHRASES) { - if (text.contains(phrase)) { - return true; - } - } - } - return EXCEPTION_TYPE_NAMES.contains(ex.getClass().getSimpleName()); - } - /** * Check via {@link #isClientDisconnectedException} if the exception * indicates the remote client disconnected, and if so log a single line @@ -93,4 +70,26 @@ public class DisconnectedClientHelper { return false; } + /** + * Whether the given exception indicates the client has gone away. + * Known cases covered: + * + */ + public static boolean isClientDisconnectedException(Throwable ex) { + String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage(); + if (message != null) { + String text = message.toLowerCase(); + for (String phrase : EXCEPTION_PHRASES) { + if (text.contains(phrase)) { + return true; + } + } + } + return EXCEPTION_TYPE_NAMES.contains(ex.getClass().getSimpleName()); + } + }