File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
auto-configurations/common/spring-ai-autoconfigure-retry/src/main/java/org/springframework/ai/retry/autoconfigure Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1717package org .springframework .ai .retry .autoconfigure ;
1818
1919import java .io .IOException ;
20+ import java .net .URI ;
2021import java .nio .charset .StandardCharsets ;
2122
2223import org .slf4j .Logger ;
3031import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
3132import org .springframework .boot .context .properties .EnableConfigurationProperties ;
3233import org .springframework .context .annotation .Bean ;
34+ import org .springframework .http .HttpMethod ;
3335import org .springframework .http .client .ClientHttpResponse ;
3436import org .springframework .lang .NonNull ;
3537import org .springframework .retry .RetryCallback ;
5052 * @author Christian Tzolov
5153 * @author SriVarshan P
5254 * @author Seunggyu Lee
55+ * @author Issam El-atif
5356 */
5457@ AutoConfiguration
5558@ ConditionalOnClass (RetryUtils .class )
@@ -104,13 +107,19 @@ public boolean hasError(@NonNull ClientHttpResponse response) throws IOException
104107 }
105108
106109 @ Override
110+ public void handleError (URI url , HttpMethod method , @ NonNull ClientHttpResponse response )
111+ throws IOException {
112+ handleError (response );
113+ }
114+
115+ @ SuppressWarnings ("removal" )
107116 public void handleError (@ NonNull ClientHttpResponse response ) throws IOException {
108117 if (!response .getStatusCode ().isError ()) {
109118 return ;
110119 }
111120
112121 String error = StreamUtils .copyToString (response .getBody (), StandardCharsets .UTF_8 );
113- if (error == null || error .isEmpty ()) {
122+ if (error .isEmpty ()) {
114123 error = "No response body available" ;
115124 }
116125
You can’t perform that action at this time.
0 commit comments