Skip to content

Commit

Permalink
RestClientException is not ClientDisconnectedException
Browse files Browse the repository at this point in the history
Fix spring-projectsGH-34264

Signed-off-by: Yanming Zhou <[email protected]>
  • Loading branch information
quaff committed Jan 16, 2025
1 parent 6873427 commit 2173fb4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@

import org.springframework.core.NestedExceptionUtils;
import org.springframework.util.Assert;
import org.springframework.web.client.RestClientException;

/**
* Utility methods to assist with identifying and logging exceptions that indicate
Expand All @@ -32,6 +33,7 @@
* and a full stacktrace at TRACE level.
*
* @author Rossen Stoyanchev
* @author Yanming Zhou
* @since 6.1
*/
public class DisconnectedClientHelper {
Expand Down Expand Up @@ -83,6 +85,9 @@ else if (logger.isDebugEnabled()) {
* </ul>
*/
public static boolean isClientDisconnectedException(Throwable ex) {
if (ex instanceof RestClientException) {
return false;
}
String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
if (message != null) {
String text = message.toLowerCase(Locale.ROOT);
Expand Down

0 comments on commit 2173fb4

Please sign in to comment.