Skip to content

Commit 2173fb4

Browse files
committed
RestClientException is not ClientDisconnectedException
Fix spring-projectsGH-34264 Signed-off-by: Yanming Zhou <[email protected]>
1 parent 6873427 commit 2173fb4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-web/src/main/java/org/springframework/web/util/DisconnectedClientHelper.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 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.
@@ -24,6 +24,7 @@
2424

2525
import org.springframework.core.NestedExceptionUtils;
2626
import org.springframework.util.Assert;
27+
import org.springframework.web.client.RestClientException;
2728

2829
/**
2930
* Utility methods to assist with identifying and logging exceptions that indicate
@@ -32,6 +33,7 @@
3233
* and a full stacktrace at TRACE level.
3334
*
3435
* @author Rossen Stoyanchev
36+
* @author Yanming Zhou
3537
* @since 6.1
3638
*/
3739
public class DisconnectedClientHelper {
@@ -83,6 +85,9 @@ else if (logger.isDebugEnabled()) {
8385
* </ul>
8486
*/
8587
public static boolean isClientDisconnectedException(Throwable ex) {
88+
if (ex instanceof RestClientException) {
89+
return false;
90+
}
8691
String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
8792
if (message != null) {
8893
String text = message.toLowerCase(Locale.ROOT);

0 commit comments

Comments
 (0)