- Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Problem
Our code breaks when users upgrade to Spring 7 because we override the deprecated handleError(ClientHttpResponse) method that gets completely removed.
Current code:
@Override public void handleError(@NonNull ClientHttpResponse response) throws IOException { // our error handling logic }What changed:
- Spring 6.2.x: Has both
handleError(response)andhandleError(url, method, response) - Spring 7.x: Removes the deprecated
handleError(response)method entirely
Solution
Implement both methods, but don't use @Override on the old one:
@Override public void handleError(URI url, HttpMethod method, @NonNull ClientHttpResponse response) throws IOException { handleError(response); // delegate to existing logic } // No @Override annotation - works in both versions public void handleError(@NonNull ClientHttpResponse response) throws IOException { // existing error handling logic stays here }How it works:
- When using Spring 6.2.x, we call the old method directly (no overhead)
- When using Spring 7.x, we call the new method, which delegates to our logic
- Same behavior, works with both versions
dev-jonghoonpark
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request