Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* error stacktrace at TRACE level.
*
* @author Rossen Stoyanchev
* @author Yanming Zhou
* @since 6.1
*/
public class DisconnectedClientHelper {
Expand All @@ -50,16 +51,8 @@ public class DisconnectedClientHelper {
private static final Set<Class<?>> CLIENT_EXCEPTION_TYPES = new HashSet<>(2);

static {
try {
ClassLoader classLoader = DisconnectedClientHelper.class.getClassLoader();
CLIENT_EXCEPTION_TYPES.add(ClassUtils.forName(
"org.springframework.web.client.RestClientException", classLoader));
CLIENT_EXCEPTION_TYPES.add(ClassUtils.forName(
"org.springframework.web.reactive.function.client.WebClientException", classLoader));
}
catch (ClassNotFoundException ex) {
// ignore
}
registerClientExceptionType("org.springframework.web.client.RestClientException");
registerClientExceptionType("org.springframework.web.reactive.function.client.WebClientException");
}


Expand Down Expand Up @@ -135,4 +128,14 @@ public static boolean isClientDisconnectedException(@Nullable Throwable ex) {
return false;
}

private static void registerClientExceptionType(String type) {
try {
ClassLoader classLoader = DisconnectedClientHelper.class.getClassLoader();
CLIENT_EXCEPTION_TYPES.add(ClassUtils.forName(type, classLoader));
}
catch (ClassNotFoundException ex) {
// ignore
}
}

}